{"openapi":"3.1.0","info":{"title":"Atomiks API","version":"1.0.0","description":"Tudo que a interface do Atomiks faz existe como operação: POST /api/v1/<id> com corpo JSON e `Authorization: Bearer atk_...` (chave criada em Configurações › Chaves de API; cada chave tem escopos e pertence a uma conta). Sucesso: {\"data\": ...}. Erro: {\"error\": {\"code\", \"message\", \"requestId\"}}. As mesmas operações são ferramentas MCP em /api/mcp (nome = id com \".\" trocado por \"_\") e comandos da CLI. Para agentes: /llms.txt (índice), /llms-full.txt (tudo em um arquivo) e qualquer página de /docs em Markdown (sufixo .md ou Accept: text/markdown).","x-llms-txt":"/llms.txt"},"servers":[{"url":"/"}],"security":[{"bearerKey":[]},{"session":[]}],"tags":[{"name":"me","description":"Quem é a chave ou a sessão, conta atual e perfil."},{"name":"auth","description":"Redefinição de senha e códigos (públicas, sem chave)."},{"name":"waitlist","description":"Entrar na lista de espera do Atomiks (pública, sem chave); a equipe convida pelo painel admin."},{"name":"admin","description":"Gestão das contas da plataforma e auditoria geral: alterações, requisições, rastro por pedido e uso de IA com custo (só a equipe do Atomiks)."},{"name":"members","description":"Membros da conta e permissões; o perfil de cada membro (members.profile_*: carteira de oportunidades, atendimento, agenda, criações, telefone e quem convidou), só para administrador."},{"name":"invites","description":"Convidar pessoas para a conta."},{"name":"api_keys","description":"Criar e revogar chaves (só pela interface)."},{"name":"activity","description":"Log de tudo que foi feito pela interface e por chaves."},{"name":"ai_usage","description":"Gasto de IA da conta: chamadas, tokens e custo em USD."},{"name":"atom","description":"Conversas com a Atom, a IA do Atomiks: mandar mensagem, confirmar ou recusar ação que altera dado, listar, abrir e apagar conversas (só pela interface)."},{"name":"channels","description":"Números de WhatsApp (Cloud API e QR code) e contas do Instagram; as telas de conexão por canal leem channel_connections.list/get (qualidade, limite e verificação do número vindos da Meta ao vivo), refresh e members."},{"name":"meta","description":"Conexão com a Meta e contas de anúncios."},{"name":"contacts","description":"Contatos, origem (anúncio), campos, etiquetas, histórico, agenda e o resumo da Atom no Raio-X (contacts.xray_summary: escrito por IA, guardado por 24 h, sem ANTHROPIC_API_KEY responde credencial_ausente)."},{"name":"ads","description":"Anúncios, quantas pessoas trouxeram e custo por conversa."},{"name":"ads_manager","description":"Árvore de campanhas com as métricas da Meta e as reais, só leitura."},{"name":"attribution","description":"Exportação de leads e vendas atribuídos a anúncios, sem dado pessoal (RealMetrics)."},{"name":"inbox","description":"Conversas, mensagens, atendimento (assumir, resolver), notas, agendadas, modelos e respostas rápidas."},{"name":"crm","description":"Funis, etapas, oportunidades, vendas, tarefas, produtos, campos, etiquetas e listas."},{"name":"capi","description":"Eventos enviados de volta à Meta: configuração, etapas e entregas."},{"name":"automations","description":"Automações de comentário, live, story e Direct do Instagram."},{"name":"calendars","description":"Horário comercial da conta."},{"name":"push","description":"Inscrição do navegador em notificações."},{"name":"flows","description":"Motor de automação multi-canal: flows versionados, publicação e teste."},{"name":"flow_runs","description":"Acompanhar, cancelar e refazer passos de execuções."},{"name":"integrations","description":"Hotmart, Kiwify, webhooks de entrada e de saída."},{"name":"audit","description":"Trilha de auditoria de um registro, como um contato (só admin)."},{"name":"notifications","description":"Central do sino: atribuições de conversa e tarefa e alertas de número, só do próprio usuário. Lista, contagem de não lidas e marcar como lida; preferências por tipo e canal (notifications.prefs_get/prefs_set: No app e Push no celular, por categoria, como a tela de Configurações › Notificações)."},{"name":"onboarding","description":"Checklist de configuração da conta: progresso calculado com os dados reais e opção de pular, por usuário e conta."},{"name":"search","description":"Busca em contatos, oportunidades, listas, segmentos, tags, pipelines, flows e produtos, respeitando o que o membro pode ver."},{"name":"attendants","description":"Atendentes (membros da conta): tipos, pipelines, canais, sala de reunião, disponibilidade, calendários e números de desempenho. Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"attendant_types","description":"Tipos como SDR e Closer: nome, ícone, cor e quantos atendentes têm cada um."},{"name":"pipelines","description":"Tipos de atendente, comissão, atendentes e peso do rodízio por pipeline; e o quadro de oportunidades como a tela do original: quadro, lista e previsão com filtros prontos, safra e pessoas, mover card conferindo as regras da etapa (campos obrigatórios e limite), ações em massa e exportar, gaveta da oportunidade e configurações do pipeline (etapas, atendentes, playbook, automação, propriedade, pixels, geral). As partes novas dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"teams","description":"Times de distribuição: membros, papel, prioridade, peso, limites por temperatura, ordem da fila 1 a 1 e estatísticas. Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"scheduling","description":"Agendas de agendamento (por atendente ou time): duração, local da reunião, perguntas, notificações, ajustes e cálculo dos horários livres a partir da disponibilidade dos atendentes e das reuniões já marcadas. Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"playbooks","description":"Roteiros de venda (etapas com perguntas, tons, gatilhos por palavra, anexos e proteções), vínculo com pipelines, playbook da conversa e simulador do copiloto com IA (claude-haiku-5-5; precisa de ANTHROPIC_API_KEY, senão credencial_ausente) e transcrição de áudio (TRANSCRIBE_PROVIDER). Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"cadences","description":"Sequências de passos em fases (ligação, WhatsApp, reunião, tarefa) que viram a próxima ação de uma oportunidade: aplicar, pausar, retomar, parar, resultado do passo (deu certo pula de fase, sem sucesso segue) e painel. Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"connections","description":"Google Calendar (agendamentos e links do Google Meet) e Google Drive por atendente: URL de consentimento, conexões, calendários que bloqueiam horários, eventos ocupados, criar/alterar/cancelar evento com Meet e arquivos do Drive. Tokens ficam cifrados. Precisam de GOOGLE_CLIENT_ID e GOOGLE_CLIENT_SECRET (senão credencial_ausente) e de uma migration (sem ela a escrita responde migration_pendente)."},{"name":"ai_agents","description":"Meus agentes: criar, editar, publicar (versão em uso), ativar e pausar agentes de IA, com rosto, persona, modelo, temperatura, ferramentas e regras de escalonamento, e o catálogo de provedores e modelos. Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"ai_credentials","description":"Chaves da OpenAI e da Anthropic da conta: cadastrar (cifrada, validada no provedor), listar só com os 4 últimos dígitos e remover. O valor nunca é devolvido. Precisam de TOKEN_ENC_KEY no servidor (senão credencial_ausente) e de uma migration (sem ela a escrita responde migration_pendente)."},{"name":"custom_objects","description":"Objetos do negócio (imóveis, veículos, contratos, turmas…): definição com nome, ícone, cor e gênero, campos com tipos, grupo, único, uso e quem preencheu, ligações com contatos, oportunidades, empresas e outros objetos (1 → vários ou vários ↔ vários), registros com responsável, vínculos, notas, histórico, visões salvas, filtros (inclusive por campos do outro lado de uma ligação: relation_filter_fields; operadores começa com e termina com), ações em massa, exportar e importar registros (CSV/TSV) e foto de campo (image_upload). Exportar, importar e ações em massa acima de 200 registros viram tarefas assíncronas: a operação devolve uma tarefa (jobId, state waiting), o worker processa em lotes e record_job_get/record_jobs_list mostram o progresso; a exportação pode avisar por e-mail (notifyEmail). Importar: records_import_upload_url devolve uma URL assinada para enviar o arquivo (até 100 MB, 100.000 linhas) e records_import recebe o uploadId com columnMappings, matchFieldId, conflictStrategy e responsibleAttendantId; records_import_ai_mapping e records_import_ai_column sugerem o mapeamento com IA (sem ANTHROPIC_API_KEY devolvem aiFailed e o mapeamento é por nome da coluna). Exigem o módulo de plano crm.custom-objects (fora do plano padrão; sem ele a resposta é forbidden) e uma migration (sem ela a escrita responde migration_pendente)."},{"name":"meetings","description":"Coaching de reunião do workspace: zonas-alvo por métrica (faixa mín./máx.), pesos da nota por etapa do método e a faixa sugerida pelas reuniões conduzidas nos últimos 30 dias (só com amostra mínima). Salvar exige membro administrador. Dependem de uma migration; sem ela a leitura devolve os padrões e a escrita responde migration_pendente."},{"name":"email_inbox","description":"Canal de e-mail por IMAP/SMTP (Gmail, Outlook, Yahoo, iCloud, Zoho ou o servidor do seu provedor): testar as credenciais antes de conectar, conectar a caixa (as senhas ficam cifradas e nunca voltam), configurar nome do remetente e assinatura (texto e logo), sincronizar a pasta Enviados, importar o histórico (7 ou 30 dias), prévia do e-mail, testar e atualizar a senha, ler a caixa na hora, ver quem tem acesso a cada caixa, enviar um e-mail novo e desconectar. As mensagens entram no atendimento como conversas do canal e-mail (anexos até 25 MB, no máximo 10 por e-mail, viram mensagens de mídia; mensagem que falha 5 vezes ao gravar é pulada e anotada em lastError) e a resposta de uma conversa sai por inbox.send. Exigem o módulo de plano messages.email-inbox (fora do plano padrão; sem ele a resposta é forbidden), TOKEN_ENC_KEY no servidor (senão credencial_ausente) e uma migration (sem ela a escrita responde migration_pendente). Só servidores públicos de e-mail."},{"name":"activities","description":"Hub global de Contatos & Comercial: atividades de todos os contatos que você enxerga (mensagens, atendimentos, compras, oportunidades, tarefas, etiquetas, automações…) com filtros por tipo, período, etiqueta, funil, automação e produto, paginação e total, estatísticas da barra lateral (por categoria, hora, contatos mais ativos), exportar em CSV como tarefa do worker (export, export_get) e o Registro de mensagens (message_leads, message_thread, message_detail). Cada item usa o eventName do Clickmax original; tipos do original sem fonte aqui aparecem em filter_options com hasSource false. Ao vivo = repetir a página 1 a cada 5 segundos. A exportação depende de uma migration (sem ela responde migration_pendente)."},{"name":"sales","description":"Minhas vendas como o painel de vendas: receita, total líquido, novas e faturas, transações, origem por UTM, compradores, gráfico, vendas de plataformas externas recebidas por integração (Hotmart, Kiwify), detalhe da venda com comprador, rastreio e transações, busca por referência externa e exportar CSV."},{"name":"channel_connections","description":"O que as telas de Configurações › WhatsApp e Instagram mostram de cada conta: identidade, status, qualidade, limite de mensagens e verificação do número (da Meta ao vivo, com cache de 5 min), quem tem acesso; refresh relê na Meta."},{"name":"custom_fields","description":"Campos customizados de contatos e oportunidades como a tela de Segmentação › Campos customizados: listar com contagens, criar, editar, editar em massa, reordenar, grupos, uso (insights) e quem preencheu (records). Dependem de uma migration; sem ela a escrita responde migration_pendente."},{"name":"audit_hub","description":"Quem alterou o quê na conta, como a tela Configurações › Auditoria: busca, período (até 1 ano), filtros por pessoa, ação, área e canal, detalhe com o que foi enviado e o IP (só admin)."},{"name":"segmentation","description":"Segmentação como no menu de Contatos: segmentos (filtros) com público e métricas, listas com emoji, contatos e histórico, tags com contagem e cor, e as tags do sistema montadas a partir do histórico de atividades."},{"name":"account","description":"Configurações › Meu usuário: perfil completo, troca de senha, plano da conta e planos disponíveis, e os aparelhos conectados (push) com desconexão."},{"name":"products","description":"Catálogo como Produtos & Entregáveis › Meus produtos: lista com ofertas e vendas, tipos de produto, detalhe com dashboard, ofertas, entregáveis, cupons, inventário e vendas, e o limite de produtos do plano. Cobrança e checkout não existem no Atomiks."},{"name":"activities_board","description":"Tarefas e agendamentos do time como Contatos & Comercial › Atividades: lista e calendário com os mesmos filtros, resumo, resultado da atividade (concluída, não deu certo, cancelada) e exportar CSV."},{"name":"roles","description":"Configurações › Permissões: cargos nomeados (além de Administrador e Membro) com as telas e módulos que liberam, duplicar, reordenar e definir quem tem cada cargo. Só admin."},{"name":"getting_started","description":"Configurações › Primeiros passos: marcos do checklist de início (produto, oferta, WhatsApp, automação, pipeline, oportunidade, primeira venda) e se o checklist está oculto."},{"name":"proposals","description":"Contatos & Comercial › Propostas: lista de propostas consolidadas com filtros e busca, modelos (templates) e consolidar proposta a partir de um modelo."},{"name":"companies","description":"Contatos & Comercial › Empresas: cadastro de empresas (razão social, CNPJ, endereço, porte, setor), contatos vinculados, oportunidades e auditoria."},{"name":"visitors","description":"Contatos & Comercial › Visitantes: resumo, lista, analytics, funil, ao vivo e exportar CSV dos visitantes das páginas. O Atomiks ainda não rastreia visitas: tudo volta vazio até existir rastreamento."},{"name":"external_recovery","description":"Vendas & Recuperação › Recuperação externa: vendas de plataformas externas com falha, chargeback, reembolso ou cancelamento e carrinhos abandonados, exportar CSV e criar lista de recuperação com os contatos."},{"name":"subscriptions","description":"Vendas & Recuperação › Assinaturas: assinaturas vindas das plataformas externas (Hotmart, Kiwify), cartões, gráfico, coortes, detalhe e exportar CSV."},{"name":"sales_recovery","description":"Vendas & Recuperação › Recuperação de vendas: vendas canceladas, pedidos externos recusados ou pendentes (Pix, boleto), reembolsos e carrinhos abandonados, com gráfico, listas e exportar CSV."},{"name":"broadcasts","description":"Mensagens › Broadcasts: lista dos disparos em massa (WhatsApp, pelo envio em massa de Contatos) com status e andamento. E-mail, SMS e ligação ainda não têm motor."},{"name":"message_history","description":"Mensagens › Histórico de envio: mensagens enviadas (individual, automação, broadcast) com status, erro e detalhe, exportar CSV, e as entregas de webhook de saída (só admin)."},{"name":"workspaces","description":"Configurações › Workspaces da conta: as contas (workspaces) do usuário com plano e papel, e renomear a conta atual (só admin)."},{"name":"pixels","description":"Marketing › Pixel e trackeamento: os pixels (dataset da API de Conversões da Meta) ligados a cada número oficial, e cadastrar um pixel num número (só admin)."},{"name":"overview","description":"Visão geral da conta: contatos capturados e totais, produtos ativos, automações e fluxos ativos no período (os números de vendas vêm de `sales.overview`)."},{"name":"groups","description":"Marketing › Grupos: campanhas de grupos de WhatsApp, números, grupos, link de captação com rotação, mensagens, agendamentos, alertas e relatórios."}],"externalDocs":{"description":"Guia para IA (Markdown)","url":"/docs/index.md"},"paths":{"/api/v1/me.get":{"post":{"operationId":"me.get","tags":["me"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/me.get.md"},"x-mcp-tool":"me_get","x-cli":"node cli/atomiks.mjs me.get --json '{...}'","x-session-only":false,"summary":"Dados do usuário e suas contas","description":"Retorna o usuário autenticado, as contas de que participa (papel, plano, permissões) e a conta atual.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"isSuperAdmin":{"type":"boolean"},"staffRole":{"anyOf":[{"type":"string","enum":["owner","admin","support","viewer"]},{"type":"null"}]},"staffPermissions":{"type":"array","items":{"type":"string"}}},"required":["id","email","name","isSuperAdmin","staffRole","staffPermissions"],"additionalProperties":false},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"plan":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}}},"required":["key","name","isFree","modules"],"additionalProperties":false},"permissions":{"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"],"additionalProperties":false}},"required":["id","name","role","plan","permissions"],"additionalProperties":false}},"currentAccountId":{"type":["string","null"]}},"required":["user","accounts","currentAccountId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth.signup":{"post":{"operationId":"auth.signup","tags":["auth"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/auth.signup.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Cadastro de nova conta","description":"Só com convite da lista de espera (`invite` = token do link recebido por e-mail, válido para o mesmo e-mail e de uso único). Cria usuário, perfil e uma conta no plano gratuito (bloqueada até liberação) com o novo usuário como administrador. Sem `company`, a conta recebe o nome do usuário.","x-scope":null,"x-access":"public","x-mutates":true,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"company":{"type":"string"},"phone":{"type":"string","maxLength":32},"email":{"type":"string"},"password":{"type":"string","minLength":8},"invite":{"type":"string","minLength":1}},"required":["name","email","password","invite"]},"example":{"name":"Maria Souza","company":"Clínica Souza","phone":"+5511999990000","email":"maria@exemplo.com","password":"minha-senha-123","invite":"token-do-convite"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"accountId":{"type":"string"}},"required":["userId","accountId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth.password_request":{"post":{"operationId":"auth.password_request","tags":["auth"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/auth.password_request.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Pede e-mail de redefinição de senha","description":"Envia link e código de 6 dígitos para redefinir a senha. Responde sempre `{ok: true}`, exista o e-mail ou não, e com limites por e-mail e por IP.","x-scope":null,"x-access":"public","x-mutates":true,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"example":{"email":"maria@exemplo.com"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth.password_reset":{"post":{"operationId":"auth.password_reset","tags":["auth"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/auth.password_reset.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Define nova senha com link ou código","description":"Aceita `{token, password}` (token do link recebido por e-mail) ou `{email, code, password}` (código de 6 dígitos do mesmo e-mail). Encerra as outras sessões e avisa por e-mail. O código tem limite de 5 tentativas por e-mail e 10 por IP por hora.","x-scope":null,"x-access":"public","x-mutates":true,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"token":{"type":"string","minLength":20},"password":{"type":"string","minLength":8}},"required":["token","password"]},{"type":"object","properties":{"email":{"type":"string"},"code":{"type":"string","pattern":"^\\d{6}$"},"password":{"type":"string","minLength":8}},"required":["email","code","password"]}]},"example":{"token":"token-do-link-recebido-por-email","password":"minha-senha-nova-123"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/waitlist.join":{"post":{"operationId":"waitlist.join","tags":["waitlist"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/waitlist.join.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Entra na lista de espera","description":"Guarda o e-mail (e o pedido feito à Atom) na lista de espera. Repetir o e-mail não duplica nem falha; `request` só é atualizado se vier um texto novo. Responde sempre `{ok: true}`, sem revelar se o e-mail já estava na lista. Limite de 10 por hora por IP.","x-scope":null,"x-access":"public","x-mutates":true,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"},"request":{"type":"string","maxLength":500},"source":{"default":"lp","type":"string","minLength":1,"maxLength":32}},"required":["email"]},"example":{"email":"maria@exemplo.com","request":"Quero organizar o atendimento da clínica","source":"lp"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth.signup_invite_get":{"post":{"operationId":"auth.signup_invite_get","tags":["auth"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/auth.signup_invite_get.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Confere um convite de cadastro","description":"Devolve o e-mail do convite se o token existe, não expirou e ainda não foi usado; senão responde `invalid_input`.","x-scope":null,"x-access":"public","x-mutates":false,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]},"example":{"token":"token-do-convite"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"}},"required":["email"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.waitlist.list":{"post":{"operationId":"admin.waitlist.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.waitlist.list.md"},"x-mcp-tool":"admin_waitlist_list","x-cli":"node cli/atomiks.mjs admin.waitlist.list --json '{...}'","x-session-only":false,"summary":"Lista a lista de espera","description":"Até 200 e-mails da lista de espera, mais recentes primeiro. `q` filtra por trecho do e-mail; `status` pelo estado do convite.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":120},"status":{"type":"string","enum":["aguardando","convidado","expirado","cadastrado"]}}},"example":{"status":"aguardando"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"request":{"type":["string","null"]},"source":{"type":"string"},"createdAt":{"type":"string"},"invitedAt":{"type":["string","null"]},"inviteExpiresAt":{"type":["string","null"]},"signedUpAt":{"type":["string","null"]},"status":{"type":"string","enum":["aguardando","convidado","expirado","cadastrado"]}},"required":["id","email","request","source","createdAt","invitedAt","inviteExpiresAt","signedUpAt","status"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.waitlist.invite":{"post":{"operationId":"admin.waitlist.invite","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.waitlist.invite.md"},"x-mcp-tool":"admin_waitlist_invite","x-cli":"node cli/atomiks.mjs admin.waitlist.invite --json '{...}'","x-session-only":false,"summary":"Convida um e-mail para o cadastro","description":"Gera um convite de uso único, válido por 14 dias, para quem está na lista de espera (ou para um e-mail novo, que entra com origem `admin`) e envia por e-mail. Convidar de novo substitui o convite anterior. Devolve também o link, para a equipe copiar se o e-mail não chegar.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"example":{"email":"maria@exemplo.com"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string"}},"required":["url","expiresAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.staff.list":{"post":{"operationId":"admin.staff.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.staff.list.md"},"x-mcp-tool":"admin_staff_list","x-cli":"node cli/atomiks.mjs admin.staff.list --json '{...}'","x-session-only":false,"summary":"Lista a equipe do painel","description":"Pessoas com acesso ao painel admin: nome, e-mail, papel (owner, admin, support ou viewer), se têm 2FA ativo, último acesso e data de entrada.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","support","viewer"]},"mfa":{"type":"boolean"},"lastSignInAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["userId","name","email","role","mfa","lastSignInAt","createdAt"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.staff.add":{"post":{"operationId":"admin.staff.add","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.staff.add.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Adiciona pessoa à equipe","description":"Dá um papel de equipe a um e-mail. Se a pessoa já tem usuário, só define o papel; se não, cria o usuário e envia o link para definir a senha. Só o dono concede o papel owner.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","support","viewer"]}},"required":["email","role"]},"example":{"email":"ana@exemplo.com","role":"support"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"created":{"type":"boolean"}},"required":["userId","created"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.staff.set_role":{"post":{"operationId":"admin.staff.set_role","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.staff.set_role.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Muda o papel de alguém da equipe","description":"Troca o papel de uma pessoa da equipe. Só o dono mexe em donos; ninguém altera o próprio papel; o último dono não pode ser rebaixado.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["owner","admin","support","viewer"]}},"required":["userId","role"]},"example":{"userId":"00000000-0000-0000-0000-000000000000","role":"admin"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.staff.remove":{"post":{"operationId":"admin.staff.remove","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.staff.remove.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Remove alguém da equipe","description":"Tira o acesso de equipe de uma pessoa (o usuário continua existindo). Só o dono remove donos; ninguém se remove; o último dono não pode ser removido.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]},"example":{"userId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.overview.get":{"post":{"operationId":"admin.overview.get","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.overview.get.md"},"x-mcp-tool":"admin_overview_get","x-cli":"node cli/atomiks.mjs admin.overview.get --json '{...}'","x-session-only":false,"summary":"Visão geral do painel","description":"Números do sistema para a equipe: contas por status, funil e novas por dia no período (7, 30 ou 90 dias), contas por plano, inativas há 14 dias, ativas sem canal e perto do limite do plano (80%), membros, canais parados (regra webhookHealth), custo de IA por dia, taxa de erro e p95 de duração das chamadas nas últimas 24 h e a fila de atenção: contas pendentes a apagar em até 3 dias, canais parados por conta e erros de log das últimas 24 h agrupados por mensagem. Blocos de IA, requisições e erros vêm null se a tabela ainda não existe. Contas de teste (dono @test.atomiks.dev) ficam fora de todos os números, salvo includeTest. Nunca retorna conteúdo.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"default":30,"anyOf":[{"type":"number","const":7},{"type":"number","const":30},{"type":"number","const":90}]},"includeTest":{"default":false,"type":"boolean"}}},"example":{"days":30,"includeTest":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accounts":{"type":"object","properties":{"total":{"type":"number"},"active":{"type":"number"},"pending":{"type":"number"},"blocked":{"type":"number"},"newInPeriod":{"type":"number"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"],"additionalProperties":false}},"funnel":{"type":"object","properties":{"registered":{"type":"number"},"pending":{"type":"number"},"active":{"type":"number"}},"required":["registered","pending","active"],"additionalProperties":false},"byPlan":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["key","name","count"],"additionalProperties":false}},"inactive":{"type":"number"},"noChannel":{"type":"number"},"nearLimit":{"type":"number"}},"required":["total","active","pending","blocked","newInPeriod","series","funnel","byPlan","inactive","noChannel","nearLimit"],"additionalProperties":false},"members":{"type":"object","properties":{"total":{"type":"number"}},"required":["total"],"additionalProperties":false},"channels":{"type":"object","properties":{"connected":{"type":"number"},"total":{"type":"number"},"staleWebhooks":{"type":"number"}},"required":["connected","total","staleWebhooks"],"additionalProperties":false},"ai":{"anyOf":[{"type":"object","properties":{"costUsd":{"type":"number"},"calls":{"type":"number"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"costUsd":{"type":"number"}},"required":["date","costUsd"],"additionalProperties":false}}},"required":["costUsd","calls","series"],"additionalProperties":false},{"type":"null"}]},"requests":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"errors":{"type":"number"},"errorRate":{"type":"number"},"p95Ms":{"type":["number","null"]}},"required":["total","errors","errorRate","p95Ms"],"additionalProperties":false},{"type":"null"}]},"attention":{"type":"object","properties":{"purging":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"owner":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"purgeAt":{"type":"string"},"daysLeft":{"type":"number"}},"required":["id","name","owner","purgeAt","daysLeft"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"errors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"module":{"type":"string"},"count":{"type":"number"},"lastAt":{"type":"string"}},"required":["message","module","count","lastAt"],"additionalProperties":false}},{"type":"null"}]}},"required":["purging","channels","errors"],"additionalProperties":false}},"required":["accounts","members","channels","ai","requests","attention"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.accounts.get":{"post":{"operationId":"admin.accounts.get","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.accounts.get.md"},"x-mcp-tool":"admin_accounts_get","x-cli":"node cli/atomiks.mjs admin.accounts.get --json '{...}'","x-session-only":false,"summary":"Detalhe de uma conta (gestão)","description":"Dono, plano, datas, membros com e-mail e último acesso, canais com último webhook, contagens de contatos e conversas e as últimas ações da equipe sobre a conta (null se o registro ainda não existe). Nunca retorna conteúdo.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["accountId"]},"example":{"accountId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["pending","active","blocked"]},"plan":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"limits":{"type":"object","properties":{"users":{"type":"number"},"channels":{"type":"number"},"contacts":{"type":"number"}},"required":["users","channels","contacts"],"additionalProperties":false}},"required":["key","name","limits"],"additionalProperties":false},"owner":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["userId","name","email"],"additionalProperties":false},"createdAt":{"type":"string"},"activatedAt":{"type":["string","null"]},"purgeAt":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]},"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"joinedAt":{"type":"string"},"lastSignInAt":{"type":["string","null"]}},"required":["userId","name","email","role","joinedAt","lastSignInAt"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"displayPhone":{"type":["string","null"]},"lastWebhookAt":{"type":["string","null"]},"health":{"type":"string","enum":["ok","stale","never","off"]}},"required":["id","kind","status","displayPhone","lastWebhookAt","health"],"additionalProperties":false}},"counts":{"type":"object","properties":{"contacts":{"type":["number","null"]},"conversations":{"type":["number","null"]}},"required":["contacts","conversations"],"additionalProperties":false},"recentAdminActions":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"actorName":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"}},"required":["at","actorName","opId","summary"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","name","status","plan","owner","createdAt","activatedAt","purgeAt","lastActivityAt","members","channels","counts","recentAdminActions"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.accounts.extend_purge":{"post":{"operationId":"admin.accounts.extend_purge","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.accounts.extend_purge.md"},"x-mcp-tool":"admin_accounts_extend_purge","x-cli":"node cli/atomiks.mjs admin.accounts.extend_purge --json '{...}'","x-session-only":false,"summary":"Adia a exclusão de uma conta pendente","description":"Soma `days` (padrão 7) ao prazo em que a conta pendente (plano gratuito nunca ativado) será apagada e devolve o novo prazo. Conta ativa ou bloqueada dá invalid_input.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"days":{"type":"integer","minimum":1,"maximum":30}},"required":["accountId"]},"example":{"accountId":"00000000-0000-0000-0000-000000000000","days":7}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"purgeAt":{"type":"string"}},"required":["purgeAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.list":{"post":{"operationId":"members.list","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.list.md"},"x-mcp-tool":"members_list","x-cli":"node cli/atomiks.mjs members.list --json '{...}'","x-session-only":false,"summary":"Lista membros e convites pendentes","description":"Retorna os membros da conta atual (com papel e permissões) e os convites ainda válidos.","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"permissions":{"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"],"additionalProperties":false},"isOwner":{"type":"boolean"},"imageUrl":{"type":["string","null"]},"lastAccessedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"stats":{"type":"object","properties":{"leads":{"type":"number"},"opportunities":{"type":"number"},"activities":{"type":"number"},"activitySeries":{"type":"array","items":{"type":"number"}}},"required":["leads","opportunities","activities","activitySeries"],"additionalProperties":false}},"required":["userId","email","name","role","permissions","isOwner","imageUrl","lastAccessedAt","createdAt","stats"],"additionalProperties":false}},"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"permissions":{"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"],"additionalProperties":false},"expiresAt":{"type":"string"},"invitedAt":{"type":"string"}},"required":["id","email","role","permissions","expiresAt","invitedAt"],"additionalProperties":false}}},"required":["members","invites"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.invite":{"post":{"operationId":"members.invite","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.invite.md"},"x-mcp-tool":"members_invite","x-cli":"node cli/atomiks.mjs members.invite --json '{...}'","x-session-only":false,"summary":"Convida alguém por link","description":"Cria um convite válido por 7 dias, envia o link por e-mail e devolve o link (para copiar se o e-mail não chegar). Conta membros mais convites pendentes contra o limite de usuários do plano.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["admin","user"]},"permissions":{"default":{"modules":"*","screens":"*","channels":"*"},"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"]}},"required":["email","role"]},"example":{"email":"secretaria@clinica.com","role":"user","permissions":{"modules":["messages"],"screens":"*","channels":"*"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"inviteId":{"type":"string"},"url":{"type":"string"},"emailSent":{"type":"boolean"}},"required":["inviteId","url","emailSent"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.update":{"post":{"operationId":"members.update","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.update.md"},"x-mcp-tool":"members_update","x-cli":"node cli/atomiks.mjs members.update --json '{...}'","x-session-only":false,"summary":"Altera papel ou permissões de um membro","description":"Não permite rebaixar o último administrador da conta.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["admin","user"]},"permissions":{"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"]}},"required":["userId"]},"example":{"userId":"00000000-0000-0000-0000-000000000000","role":"user"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"}},"required":["userId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.remove":{"post":{"operationId":"members.remove","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.remove.md"},"x-mcp-tool":"members_remove","x-cli":"node cli/atomiks.mjs members.remove --json '{...}'","x-session-only":false,"summary":"Remove um membro da conta","description":"Não remove o dono. Revoga as chaves de API do membro nesta conta.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"}},"required":["userId"]},"example":{"userId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"}},"required":["userId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invites.revoke":{"post":{"operationId":"invites.revoke","tags":["invites"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/invites.revoke.md"},"x-mcp-tool":"invites_revoke","x-cli":"node cli/atomiks.mjs invites.revoke --json '{...}'","x-session-only":false,"summary":"Revoga um convite pendente","description":"O link deixa de funcionar.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"inviteId":{"type":"string"}},"required":["inviteId"]},"example":{"inviteId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invites.accept":{"post":{"operationId":"invites.accept","tags":["invites"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/invites.accept.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Aceita um convite","description":"O e-mail da sessão precisa ser o do convite. Não cria conta nova: entra na conta que convidou.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":10}},"required":["token"]},"example":{"token":"token-do-link"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invites.signup":{"post":{"operationId":"invites.signup","tags":["invites"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/invites.signup.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":false,"summary":"Cria usuário a partir de um convite","description":"Valida o convite, cria o usuário com o e-mail do convite (sem criar conta) e já o coloca na conta que convidou.","x-scope":null,"x-access":"public","x-mutates":true,"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","minLength":10},"name":{"type":"string","minLength":1},"password":{"type":"string","minLength":8}},"required":["token","name","password"]},"example":{"token":"token-do-link","name":"Maria","password":"uma-senha-forte"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string"},"email":{"type":"string"}},"required":["accountId","email"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api_keys.list":{"post":{"operationId":"api_keys.list","tags":["api_keys"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/api_keys.list.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Listar chaves de API da conta","description":"Lista as chaves de API da conta atual (prefixo, escopos, último uso e revogação). A chave completa nunca é devolvida aqui.","x-scope":null,"x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["account:read","account:write","team:read","team:write","activity:read","admin:read","admin:write","channels:read","channels:write","contacts:read","ads:read","ads:write","messages:read","messages:send","messages:manage","crm:read","crm:write","conversions:read","conversions:write","automations:read","automations:write","marketing:read","marketing:write"]}},"lastUsedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"revokedAt":{"type":["string","null"]}},"required":["id","name","prefix","scopes","lastUsedAt","createdAt","revokedAt"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api_keys.create":{"post":{"operationId":"api_keys.create","tags":["api_keys"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/api_keys.create.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Criar chave de API","description":"Cria uma chave de API com escopos. A chave completa (`key`) aparece só nesta resposta; guarde-a. Escopos `admin:*` só para super-admin.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["account:read","account:write","team:read","team:write","activity:read","admin:read","admin:write","channels:read","channels:write","contacts:read","ads:read","ads:write","messages:read","messages:send","messages:manage","crm:read","crm:write","conversions:read","conversions:write","automations:read","automations:write","marketing:read","marketing:write"]}}},"required":["name","scopes"]},"example":{"name":"Integração","scopes":["team:read"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"}},"required":["id","key"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api_keys.update":{"post":{"operationId":"api_keys.update","tags":["api_keys"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/api_keys.update.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Editar chave de API","description":"Troca o nome e os escopos de uma chave ativa da conta atual. Vale na próxima requisição da chave; o segredo não muda. Uma chave não passa de comum para administração (nem o contrário): crie outra.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["account:read","account:write","team:read","team:write","activity:read","admin:read","admin:write","channels:read","channels:write","contacts:read","ads:read","ads:write","messages:read","messages:send","messages:manage","crm:read","crm:write","conversions:read","conversions:write","automations:read","automations:write","marketing:read","marketing:write"]}}},"required":["id","name","scopes"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Integração","scopes":["team:read","messages:read"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api_keys.revoke":{"post":{"operationId":"api_keys.revoke","tags":["api_keys"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/api_keys.revoke.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Revogar chave de API","description":"Revoga uma chave de API da conta atual; ela deixa de funcionar na hora.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activity.list":{"post":{"operationId":"activity.list","tags":["activity"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activity.list.md"},"x-mcp-tool":"activity_list","x-cli":"node cli/atomiks.mjs activity.list --json '{...}'","x-session-only":false,"summary":"Listar atividade da conta","description":"Registro de atividade da conta atual, do mais recente para o mais antigo. Use `before` (id do último item) para a página seguinte.","x-scope":"activity:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"example":{"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"action":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":"string"},"actor":{"type":"object","properties":{"kind":{"type":"string","enum":["user","api_key","system"]},"name":{"type":"string"}},"required":["kind","name"],"additionalProperties":false}},"required":["id","createdAt","action","targetType","targetId","actor"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.accounts.list":{"post":{"operationId":"admin.accounts.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.accounts.list.md"},"x-mcp-tool":"admin_accounts_list","x-cli":"node cli/atomiks.mjs admin.accounts.list --json '{...}'","x-session-only":false,"summary":"Lista contas (gestão)","description":"Lista contas com dono, plano, status (pending, active ou blocked), número de membros, canais de WhatsApp conectados, hora do último webhook recebido e datas. `status` aceita pending, active ou all; contas bloqueadas (plano gratuito já ativado antes) só aparecem em all. `plano` filtra pela chave do plano, `inativas` por dias sem atividade (sem atividade, conta desde a criação) e `canal: problema` por contas com canal parado ou que nunca recebeu evento (`channelsAttention`), `canal: sem` por contas sem canal conectado, `includeTest` inclui as contas de teste (dono @test.atomiks.dev), escondidas por padrão, e `limite` (percentual, ex. 80) por contas com membros ou canais a esse percentual ou mais do limite do plano. Nunca retorna conteúdo.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["pending","active","all"]},"q":{"type":"string"},"plano":{"type":"string"},"inativas":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"canal":{"type":"string","enum":["problema","sem"]},"limite":{"type":"integer","minimum":1,"maximum":100},"includeTest":{"type":"boolean"}}},"example":{"status":"all"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"owner":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"plan":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","active","blocked"]},"members":{"type":"number"},"channels":{"type":"number"},"lastWebhookAt":{"type":["string","null"]},"createdAt":{"type":"string"},"activatedAt":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]},"purgeAt":{"type":["string","null"]},"channelsAttention":{"type":"number"},"nearLimit":{"type":"number"}},"required":["id","name","owner","plan","status","members","channels","lastWebhookAt","createdAt","activatedAt","lastActivityAt","purgeAt","channelsAttention","nearLimit"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.accounts.set_plan":{"post":{"operationId":"admin.accounts.set_plan","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.accounts.set_plan.md"},"x-mcp-tool":"admin_accounts_set_plan","x-cli":"node cli/atomiks.mjs admin.accounts.set_plan --json '{...}'","x-session-only":false,"summary":"Define o plano de uma conta","description":"Troca o plano da conta. Na primeira vez que o plano deixa de ser gratuito, a conta é ativada (activated_at) e deixa de ser apagada. Voltar ao plano gratuito bloqueia a conta, sem apagá-la.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"planKey":{"type":"string","minLength":1}},"required":["accountId","planKey"]},"example":{"accountId":"00000000-0000-0000-0000-000000000000","planKey":"teste"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"planKey":{"type":"string"},"previousPlanKey":{"type":["string","null"]},"activatedAt":{"type":["string","null"]}},"required":["id","planKey","previousPlanKey","activatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.plans.list":{"post":{"operationId":"admin.plans.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.plans.list.md"},"x-mcp-tool":"admin_plans_list","x-cli":"node cli/atomiks.mjs admin.plans.list --json '{...}'","x-session-only":false,"summary":"Lista planos","description":"Lista os planos com módulos liberados e limites.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"users":{"type":"integer","minimum":0,"maximum":9007199254740991},"channels":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":0,"maximum":9007199254740991},"mediaRetentionDays":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["users","channels","contacts","mediaRetentionDays"],"additionalProperties":false},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","key","name","isFree","modules","limits"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.plans.upsert":{"post":{"operationId":"admin.plans.upsert","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.plans.upsert.md"},"x-mcp-tool":"admin_plans_upsert","x-cli":"node cli/atomiks.mjs admin.plans.upsert --json '{...}'","x-session-only":false,"summary":"Cria ou altera um plano","description":"Cria ou altera o plano identificado por `key`. Não há operação para apagar planos nesta etapa.","x-scope":"admin:write","x-access":"super_admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"key":{"type":"string","minLength":1,"pattern":"^[a-z0-9_-]+$"},"name":{"type":"string","minLength":1},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"users":{"type":"integer","minimum":0,"maximum":9007199254740991},"channels":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":0,"maximum":9007199254740991},"mediaRetentionDays":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["users","channels","contacts","mediaRetentionDays"]}},"required":["key","name","isFree","modules","limits"]},"example":{"key":"teste","name":"Teste","isFree":false,"modules":["messages","crm"],"limits":{"users":5,"channels":2,"contacts":10000,"mediaRetentionDays":7}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"users":{"type":"integer","minimum":0,"maximum":9007199254740991},"channels":{"type":"integer","minimum":0,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":0,"maximum":9007199254740991},"mediaRetentionDays":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["users","channels","contacts","mediaRetentionDays"],"additionalProperties":false},"accounts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","key","name","isFree","modules","limits"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.logs.list":{"post":{"operationId":"admin.logs.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.logs.list.md"},"x-mcp-tool":"admin_logs_list","x-cli":"node cli/atomiks.mjs admin.logs.list --json '{...}'","x-session-only":false,"summary":"Lista logs de sistema","description":"Linhas de system_logs (warn e error), mais recentes primeiro, com conta por nome, total e filtros opcionais (nível, módulo, mensagem exata, conta, período). Use `before` (id do último item) para a página seguinte. Os logs nunca guardam conteúdo de mensagens, telefones, senhas ou tokens.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"level":{"type":"string","enum":["warn","error"]},"module":{"type":"string"},"message":{"type":"string"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":500},"includeTest":{"type":"boolean"}}},"example":{"level":"error","limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"level":{"type":"string"},"module":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"userId":{"type":["string","null"]},"requestId":{"type":["string","null"]},"message":{"type":"string"},"context":{}},"required":["id","ts","level","module","accountId","accountName","userId","requestId","message","context"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]},"total":{"type":["number","null"]}},"required":["items","nextBefore","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.logs.groups":{"post":{"operationId":"admin.logs.groups","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.logs.groups.md"},"x-mcp-tool":"admin_logs_groups","x-cli":"node cli/atomiks.mjs admin.logs.groups --json '{...}'","x-session-only":false,"summary":"Agrupa logs de sistema","description":"Agrupa system_logs por nível, módulo e mensagem no período inteiro (contagem real), mais recente primeiro. `accountId` só vem quando todas as ocorrências são da mesma conta. Contas de teste ficam de fora, a menos que `includeTest` seja true. `sampleId` é a ocorrência mais recente; `truncated` indica que o período passou do limite de linhas lidas.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"level":{"type":"string","enum":["warn","error"]},"module":{"type":"string"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"includeTest":{"type":"boolean"}}},"example":{"level":"error","from":"2026-10-20T00:00:00Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"module":{"type":"string"},"message":{"type":"string"},"count":{"type":"number"},"firstAt":{"type":"string"},"lastAt":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"sampleId":{"type":"number"}},"required":["level","module","message","count","firstAt","lastAt","accountId","accountName","sampleId"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["groups","truncated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.audit.list":{"post":{"operationId":"admin.audit.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.audit.list.md"},"x-mcp-tool":"admin_audit_list","x-cli":"node cli/atomiks.mjs admin.audit.list --json '{...}'","x-session-only":false,"summary":"Auditoria geral (todas as contas)","description":"Registro de atividade de todas as contas, do mais recente ao mais antigo, com conta, pessoa (nome e e-mail), canal (via), ação, item, entrada já redigida, IP e id da requisição. Filtros por conta, pessoa, ação (prefixo), canal e período. Use `before` (id do último item) para a página seguinte; até 200 por página.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"op":{"type":"string","maxLength":80},"via":{"maxItems":6,"type":"array","items":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]}},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"includeTest":{"type":"boolean"}}},"example":{"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"actor":{"type":"object","properties":{"kind":{"type":"string","enum":["user","api_key","system"]},"id":{"type":["string","null"]},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["kind","id","name","email"],"additionalProperties":false},"via":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]},"action":{"type":"string"},"actionLabel":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":"string"},"targetLabel":{"type":"string"},"detail":{"type":["string","null"]},"input":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"ip":{"type":["string","null"]},"requestId":{"type":["string","null"]}},"required":["id","createdAt","accountId","accountName","actor","via","action","actionLabel","targetType","targetId","targetLabel","detail","input","ip","requestId"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.requests.list":{"post":{"operationId":"admin.requests.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.requests.list.md"},"x-mcp-tool":"admin_requests_list","x-cli":"node cli/atomiks.mjs admin.requests.list --json '{...}'","x-session-only":false,"summary":"Chamadas de operação (todas as contas)","description":"Toda chamada de operação, leitura inclusive, sem a entrada: quem, por qual canal, status, erro e duração. Mais recentes primeiro; `errorsOnly` mostra só status 400 ou mais; filtros por canal (`via`) e período. Use `before` para a página seguinte; até 200 por página.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"op":{"type":"string","maxLength":80},"errorsOnly":{"type":"boolean"},"includeAdminReads":{"type":"boolean"},"via":{"maxItems":6,"type":"array","items":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]}},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"includeTest":{"type":"boolean"}}},"example":{"errorsOnly":true,"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"actorName":{"type":"string"},"via":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]},"op":{"type":"string"},"opLabel":{"type":"string"},"mutates":{"type":"boolean"},"status":{"type":"number"},"errorCode":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"durationMs":{"type":"number"},"ip":{"type":["string","null"]},"requestId":{"type":["string","null"]}},"required":["id","ts","accountId","accountName","actorName","via","op","opLabel","mutates","status","errorCode","errorMessage","durationMs","ip","requestId"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.trace.get":{"post":{"operationId":"admin.trace.get","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.trace.get.md"},"x-mcp-tool":"admin_trace_get","x-cli":"node cli/atomiks.mjs admin.trace.get --json '{...}'","x-session-only":false,"summary":"Rastro de uma requisição","description":"Tudo o que uma requisição fez: chamadas de operação, atividade, logs de sistema e chamadas de IA com o mesmo id de requisição. `around` (hora da linha) limita a ±1 h; até 100 itens por tabela.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requestId":{"type":"string","minLength":1,"maxLength":100},"around":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["requestId"]},"example":{"requestId":"req-1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"actorName":{"type":"string"},"via":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]},"op":{"type":"string"},"opLabel":{"type":"string"},"mutates":{"type":"boolean"},"status":{"type":"number"},"errorCode":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"durationMs":{"type":"number"},"ip":{"type":["string","null"]},"requestId":{"type":["string","null"]}},"required":["id","ts","accountId","accountName","actorName","via","op","opLabel","mutates","status","errorCode","errorMessage","durationMs","ip","requestId"],"additionalProperties":false}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"actor":{"type":"object","properties":{"kind":{"type":"string","enum":["user","api_key","system"]},"id":{"type":["string","null"]},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["kind","id","name","email"],"additionalProperties":false},"via":{"type":"string","enum":["ui","api","mcp","atom","flow","system"]},"action":{"type":"string"},"actionLabel":{"type":"string"},"targetType":{"type":"string"},"targetId":{"type":"string"},"targetLabel":{"type":"string"},"detail":{"type":["string","null"]},"input":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"ip":{"type":["string","null"]},"requestId":{"type":["string","null"]}},"required":["id","createdAt","accountId","accountName","actor","via","action","actionLabel","targetType","targetId","targetLabel","detail","input","ip","requestId"],"additionalProperties":false}},"ai":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"userName":{"type":"string"},"feature":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheWriteTokens":{"type":"number"},"audioSeconds":{"type":"number"},"costUsd":{"type":"number"},"latencyMs":{"type":["number","null"]},"status":{"type":"string"},"error":{"type":["string","null"]},"requestId":{"type":["string","null"]},"conversationId":{"type":["string","null"]}},"required":["id","ts","accountId","accountName","userName","feature","provider","model","inputTokens","outputTokens","cacheReadTokens","cacheWriteTokens","audioSeconds","costUsd","latencyMs","status","error","requestId","conversationId"],"additionalProperties":false}},"logs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"level":{"type":"string"},"module":{"type":"string"},"message":{"type":"string"},"context":{}},"required":["id","ts","level","module","message","context"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["requests","activity","ai","logs","truncated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.ai_usage.summary":{"post":{"operationId":"admin.ai_usage.summary","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.ai_usage.summary.md"},"x-mcp-tool":"admin_ai_usage_summary","x-cli":"node cli/atomiks.mjs admin.ai_usage.summary --json '{...}'","x-session-only":false,"summary":"Gasto de IA agregado (todas as contas)","description":"Soma de chamadas, tokens e custo em USD das chamadas de IA no período, agrupada por conta, pessoa, modelo, recurso ou dia (fuso de São Paulo). Soma feita no banco.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"groupBy":{"type":"string","enum":["account","user","model","feature","day"]},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"includeTest":{"type":"boolean"}},"required":["from","to","groupBy"]},"example":{"from":"2026-10-01T00:00:00-03:00","to":"2026-11-01T00:00:00-03:00","groupBy":"account"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totals":{"type":"object","properties":{"calls":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"costUsd":{"type":"number"}},"required":["calls","inputTokens","outputTokens","costUsd"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"calls":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"audioSeconds":{"type":"number"},"costUsd":{"type":"number"}},"required":["key","label","calls","inputTokens","outputTokens","cacheReadTokens","audioSeconds","costUsd"],"additionalProperties":false}}},"required":["totals","rows"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.ai_usage.list":{"post":{"operationId":"admin.ai_usage.list","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.ai_usage.list.md"},"x-mcp-tool":"admin_ai_usage_list","x-cli":"node cli/atomiks.mjs admin.ai_usage.list --json '{...}'","x-session-only":false,"summary":"Chamadas de IA (todas as contas)","description":"Cada chamada a provedor de IA: recurso, modelo, tokens, custo em USD, latência e status. Nunca guarda prompt nem resposta. Use `before` para a página seguinte; até 200 por página.","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feature":{"type":"string","maxLength":80},"model":{"type":"string","maxLength":120},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"includeTest":{"type":"boolean"}}},"example":{"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"ts":{"type":"string"},"accountId":{"type":["string","null"]},"accountName":{"type":["string","null"]},"userName":{"type":"string"},"feature":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"cacheWriteTokens":{"type":"number"},"audioSeconds":{"type":"number"},"costUsd":{"type":"number"},"latencyMs":{"type":["number","null"]},"status":{"type":"string"},"error":{"type":["string","null"]},"requestId":{"type":["string","null"]},"conversationId":{"type":["string","null"]}},"required":["id","ts","accountId","accountName","userName","feature","provider","model","inputTokens","outputTokens","cacheReadTokens","cacheWriteTokens","audioSeconds","costUsd","latencyMs","status","error","requestId","conversationId"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin.requests.summary":{"post":{"operationId":"admin.requests.summary","tags":["admin"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/admin.requests.summary.md"},"x-mcp-tool":"admin_requests_summary","x-cli":"node cli/atomiks.mjs admin.requests.summary --json '{...}'","x-session-only":false,"summary":"Chamadas de operação agregadas","description":"Chamadas, erros (status 400 ou mais) e duração média no período, agrupadas por conta, pessoa, operação ou dia (fuso de São Paulo). Soma feita no banco; devolve os 100 grupos com mais chamadas (por dia, todos).","x-scope":"admin:read","x-access":"super_admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"groupBy":{"type":"string","enum":["account","user","op","day"]},"includeAdminReads":{"type":"boolean"},"includeTest":{"type":"boolean"}},"required":["from","to","groupBy"]},"example":{"from":"2026-10-01T00:00:00-03:00","to":"2026-11-01T00:00:00-03:00","groupBy":"op"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"calls":{"type":"number"},"errors":{"type":"number"},"avgMs":{"type":"number"}},"required":["key","label","calls","errors","avgMs"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_usage.summary":{"post":{"operationId":"ai_usage.summary","tags":["ai_usage"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_usage.summary.md"},"x-mcp-tool":"ai_usage_summary","x-cli":"node cli/atomiks.mjs ai_usage.summary --json '{...}'","x-session-only":false,"summary":"Gasto de IA da conta","description":"Soma de chamadas, tokens e custo em USD das chamadas de IA da conta atual no período, agrupada por pessoa, modelo, recurso ou dia (fuso de São Paulo).","x-scope":"activity:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"groupBy":{"type":"string","enum":["account","user","model","feature","day"]}},"required":["from","to","groupBy"]},"example":{"from":"2026-10-01T00:00:00-03:00","to":"2026-11-01T00:00:00-03:00","groupBy":"user"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totals":{"type":"object","properties":{"calls":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"costUsd":{"type":"number"}},"required":["calls","inputTokens","outputTokens","costUsd"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"calls":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cacheReadTokens":{"type":"number"},"audioSeconds":{"type":"number"},"costUsd":{"type":"number"}},"required":["key","label","calls","inputTokens","outputTokens","cacheReadTokens","audioSeconds","costUsd"],"additionalProperties":false}}},"required":["totals","rows"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/atom.conversations.list":{"post":{"operationId":"atom.conversations.list","tags":["atom"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/atom.conversations.list.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Listar conversas com a Atom","description":"Histórico de conversas do usuário na conta atual, da mais recente para a mais antiga.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"default":30,"type":"integer","minimum":1,"maximum":50},"before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"example":{"limit":30}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"preview":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","preview","updatedAt"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/atom.conversations.get":{"post":{"operationId":"atom.conversations.get","tags":["atom"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/atom.conversations.get.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Abrir conversa com a Atom","description":"Mensagens, ações e confirmações pendentes de uma conversa.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["done","error","pending","declined"]}},"required":["id","opId","summary","status"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","role","text","actions","createdAt"],"additionalProperties":false}},"pending":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["actionId","opId","summary","input"],"additionalProperties":false}}},"required":["id","title","messages","pending"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/atom.conversations.delete":{"post":{"operationId":"atom.conversations.delete","tags":["atom"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/atom.conversations.delete.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Apagar conversa com a Atom","description":"Tira a conversa do histórico (apagamento lógico).","x-scope":null,"x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/atom.chat.send":{"post":{"operationId":"atom.chat.send","tags":["atom"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/atom.chat.send.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Conversar com a Atom","description":"Manda uma mensagem à Atom (abre conversa nova sem conversationId) e devolve a conversa atualizada. Ação que altera dados volta em `pending`.","x-scope":null,"x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":8000}},"required":["text"]},"example":{"text":"Quantos contatos eu tenho?"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["done","error","pending","declined"]}},"required":["id","opId","summary","status"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","role","text","actions","createdAt"],"additionalProperties":false}},"pending":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["actionId","opId","summary","input"],"additionalProperties":false}}},"required":["id","title","messages","pending"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/atom.chat.confirm":{"post":{"operationId":"atom.chat.confirm","tags":["atom"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/atom.chat.confirm.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Confirmar ou recusar ação da Atom","description":"Aprova ou recusa a ação pendente da conversa e deixa a Atom continuar.","x-scope":null,"x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"approve":{"type":"boolean"}},"required":["conversationId","approve"]},"example":{"conversationId":"00000000-0000-4000-8000-000000000000","approve":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["done","error","pending","declined"]}},"required":["id","opId","summary","status"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","role","text","actions","createdAt"],"additionalProperties":false}},"pending":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string"},"opId":{"type":"string"},"summary":{"type":"string"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["actionId","opId","summary","input"],"additionalProperties":false}}},"required":["id","title","messages","pending"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.list":{"post":{"operationId":"channels.list","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.list.md"},"x-mcp-tool":"channels_list","x-cli":"node cli/atomiks.mjs channels.list --json '{...}'","x-session-only":false,"summary":"Listar canais de WhatsApp","description":"Números de WhatsApp conectados à conta atual que o membro pode usar, com estado e hora do último webhook recebido.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"connectionType":{"type":"string","enum":["coexistence","new_number","qr","instagram_login","unified_login"]},"status":{"type":"string","enum":["connecting","syncing","ready","failed","disconnected"]},"displayPhone":{"type":["string","null"]},"verifiedName":{"type":["string","null"]},"lastWebhookAt":{"type":["string","null"]},"humanAgent":{"type":"boolean"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"provider":{"anyOf":[{"type":"string","enum":["evolution","waha"]},{"type":"null"}]}},"required":["id","kind","connectionType","status","displayPhone","verifiedName","lastWebhookAt","humanAgent","receiveGroups","alwaysOnline","provider"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.signup_start":{"post":{"operationId":"channels.signup_start","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.signup_start.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Iniciar a conexão de um número de WhatsApp","description":"Cria uma sessão de conexão (válida por 10 minutos, uso único) e devolve o que a janela da Meta precisa: appId, configId e state. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","enum":["coexistence","new_number"]}},"required":["mode"]},"example":{"mode":"coexistence"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"appId":{"type":"string"},"configId":{"type":"string"},"state":{"type":"string"}},"required":["id","appId","configId","state"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.signup_complete":{"post":{"operationId":"channels.signup_complete","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.signup_complete.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Concluir a conexão de um número de WhatsApp","description":"Recebe o resultado da janela da Meta, liga o webhook do Atomiks neste número e cria o canal. Coexistência fica em `syncing` até o histórico chegar. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":2000},"wabaId":{"type":"string","pattern":"^\\d{1,40}$"},"phoneNumberId":{"type":"string","pattern":"^\\d{1,40}$"},"state":{"type":"string","minLength":16,"maxLength":200},"mode":{"type":"string","enum":["coexistence","new_number"]}},"required":["code","wabaId","phoneNumberId","state","mode"]},"example":{"code":"AQB...","wabaId":"123456789","phoneNumberId":"987654321","state":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","mode":"coexistence"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"status":{"type":"string","enum":["ready","syncing"]}},"required":["id","channelId","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.disconnect":{"post":{"operationId":"channels.disconnect","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.disconnect.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Desconectar um número de WhatsApp","description":"Remove o webhook do Atomiks do número (ele volta ao webhook padrão do app; número por QR code sai e apaga a instância na Evolution) e marca o canal como desconectado. As conversas continuam na conta.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"overrideCleared":{"type":"boolean"}},"required":["id","overrideCleared"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meta.connection_get":{"post":{"operationId":"meta.connection_get","tags":["meta"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meta.connection_get.md"},"x-mcp-tool":"meta_connection_get","x-cli":"node cli/atomiks.mjs meta.connection_get --json '{...}'","x-session-only":false,"summary":"Ver a conexão da conta de anúncios","description":"Estado da conexão com a conta de anúncios da Meta e quantos anúncios cruzaram ou não com a conta conectada. `status` é `none` quando nunca conectou. `matching.okLast7d` conta anúncios resolvidos nos últimos 7 dias.","x-scope":"ads:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["none","active","expired","revoked"]},"fbUserName":{"type":["string","null"]},"adAccountId":{"type":["string","null"]},"adAccountName":{"type":["string","null"]},"tokenExpiresAt":{"type":["string","null"]},"matching":{"type":"object","properties":{"checked":{"type":"number"},"notMatched":{"type":"number"},"okLast7d":{"type":"number"}},"required":["checked","notMatched","okLast7d"],"additionalProperties":false}},"required":["status","fbUserName","adAccountId","adAccountName","tokenExpiresAt","matching"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meta.ad_accounts_list":{"post":{"operationId":"meta.ad_accounts_list","tags":["meta"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meta.ad_accounts_list.md"},"x-mcp-tool":"meta_ad_accounts_list","x-cli":"node cli/atomiks.mjs meta.ad_accounts_list --json '{...}'","x-session-only":false,"summary":"Listar contas de anúncios do perfil conectado","description":"Contas de anúncios que o perfil do Facebook conectado enxerga (consulta a Meta na hora). Exige conexão ativa.","x-scope":"ads:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"business":{"type":["string","null"]},"currency":{"type":["string","null"]},"status":{"type":"string","enum":["active","inactive"]}},"required":["id","name","business","currency","status"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meta.ad_account_select":{"post":{"operationId":"meta.ad_account_select","tags":["meta"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meta.ad_account_select.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Escolher a conta de anúncios","description":"Define qual conta de anúncios (`act_...`) a conta do Atomiks usa e recoloca todos os anúncios em cache para nova consulta. A conta precisa estar entre as do perfil conectado.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adAccountId":{"type":"string","pattern":"^act_\\d+$"}},"required":["adAccountId"]},"example":{"adAccountId":"act_1234567890"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"adAccountId":{"type":"string"},"adAccountName":{"type":"string"}},"required":["id","adAccountId","adAccountName"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meta.disconnect":{"post":{"operationId":"meta.disconnect","tags":["meta"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meta.disconnect.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Desconectar a conta de anúncios","description":"Revoga as permissões do app na Meta (melhor esforço) e apaga a conexão e o token da conta de anúncios. `revokedAtMeta` é `false` quando a Meta recusou ou não respondeu; a conexão some do Atomiks do mesmo jeito. Os anúncios já resolvidos continuam em cache; novos não são consultados até reconectar.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"revokedAtMeta":{"type":"boolean"}},"required":["id","revokedAtMeta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.list":{"post":{"operationId":"contacts.list","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.list.md"},"x-mcp-tool":"contacts_list","x-cli":"node cli/atomiks.mjs contacts.list --json '{...}'","x-session-only":false,"summary":"Listar contatos","description":"Contatos da conta atual, só os que o membro pode ver (administrador vê todos; os demais, os de conversas nos números liberados e os que criou). Contatos na lixeira nunca aparecem.\n\nFiltros: `q` (busca em nome, telefone, e-mail e instagram), `filter` (segmento: lista de nós no formato do construtor de segmentos; grupo = `{id, field: \"children\", operator: \"childrenAnd\"|\"childrenOr\"}` e as condições apontam o grupo em `parentId`; nós sem `parentId` se combinam com E; `negation: true` inverte; valor em `valueString`, `valueNumber`, `valueDate` (AAAA-MM-DD ou ISO), `valueBool` ou `valueUuid`, e listas como JSON em `valueString`). Campos: `name`, `email`, `email_secondary`, `phone`, `instagram`, `linkedin`, `document`, `city`, `state`, `profession`, `language`, `gender`, `birthday`, `created_at`, `updated_at`, `last_activity_at`, `origin_kind`, `ad_id`, `campaign`, `tag`, `list`, `channel` (id do número), `opt_in`/`opt_out` (canal), `temperature`, `temperature_band`, `score`, `score_tier`, `open_opportunities`, `is_customer`, `lgpd`, `email_status` e `cf:<id do campo personalizado>`. Operadores: `contains`, `equals`, `startsWith`, `endsWith`, `isNotEmpty`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`, `inLast`/`moreThan` (dias, em `valueNumber`) e `in`. Campo ou operador fora do catálogo dá `invalid_input`.\n\nOs filtros antigos continuam: `origin` (`ad` = primeira indicação de anúncio; `organic` = todo o resto), `adId` e `channelId`, combinados com E.\n\nOrdenação `sort: {key, dir}`: `created` (padrão, mais novo primeiro), `temperature`, `score`, `opportunities`, `name`, `last_activity`; vazios por último.\n\nPaginação por número de página (`page` a partir de 1, `perPage` 20, 50 ou 100) ou por `cursor` (`nextCursor`, tamanho em `limit`; só com a ordenação padrão). `page` e `cursor` juntos dão `invalid_input`. `total` conta tudo que casa com os filtros, sem o cursor.\n\nCada item traz o que a tabela de contatos mostra: código, origem (`kind` entre `ad`, `organic`, `manual`, `import`, `integration`, `instagram`, `form`, `api`; anúncio e campanha só com consulta à Meta `ok`), indicadores (temperatura e score `null` = ainda sem cálculo), oportunidades abertas, cliente, canais (opt-in por canal: `opted_in`, `opted_out` ou `none` = sem registro, que vale \"pode receber\"; `hasConversation` só para whatsapp e instagram), tags, tags de sistema (último momento de cada tipo de atividade, mais recente primeiro), campos personalizados por id e as colunas de cadastro. `emailStatus` fica `unverified` até existir verificação real; `possibleFraud` é sempre `null` (sem fonte).","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"origin":{"type":"string","enum":["ad","organic"]},"adId":{"type":"string","maxLength":100},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":100},"limit":{"type":"integer","minimum":1,"maximum":100},"cursor":{"type":"string","maxLength":300},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"anyOf":[{"type":"number","const":20},{"type":"number","const":50},{"type":"number","const":100}]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"sort":{"type":"object","properties":{"key":{"type":"string","enum":["created","temperature","score","opportunities","name","last_activity"]},"dir":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["key"]}}},"example":{"page":1,"perPage":20,"sort":{"key":"temperature","dir":"desc"},"filter":[{"field":"tag","operator":"in","negation":false,"valueString":"[\"00000000-0000-0000-0000-000000000000\"]"},{"field":"temperature","operator":"greaterThanOrEqual","negation":false,"valueNumber":60}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"origin":{"type":"object","properties":{"kind":{"type":"string","enum":["ad","organic","manual","import","integration","instagram","form","api"]},"detail":{"type":["string","null"]},"adId":{"type":["string","null"]},"adName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"headline":{"type":["string","null"]}},"required":["kind","detail","adId","adName","campaignName","headline"],"additionalProperties":false},"code":{"type":["number","null"]},"email":{"type":["string","null"]},"emailStatus":{"type":"string","enum":["unverified","valid","invalid","bounced","unsubscribed"]},"instagram":{"type":["string","null"]},"telegram":{"type":["string","null"]},"document":{"type":["string","null"]},"temperature":{"type":["number","null"]},"temperatureBand":{"anyOf":[{"type":"string","enum":["cold","warm","hot"]},{"type":"null"}]},"temperatureTrend":{"type":["number","null"]},"temperatureUpdatedAt":{"type":["string","null"]},"score":{"type":["number","null"]},"scoreTier":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}]},"openOpportunities":{"type":"number"},"isCustomer":{"type":"boolean"},"lastActivityAt":{"type":["string","null"]},"channels":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","instagram","email","sms","telegram","voice"]},"consent":{"type":"string","enum":["opted_in","opted_out","none"]},"hasConversation":{"type":"boolean"}},"required":["channel","consent","hasConversation"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"systemTags":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"at":{"type":"string"}},"required":["key","label","at"],"additionalProperties":false}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"emailSecondary":{"type":["string","null"]},"linkedin":{"type":["string","null"]},"profession":{"type":["string","null"]},"language":{"type":["string","null"]},"gender":{"anyOf":[{"type":"string","enum":["male","female","other"]},{"type":"null"}]},"birthday":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"cep":{"type":"string"},"rua":{"type":"string"},"numero":{"type":"string"},"complemento":{"type":"string"},"bairro":{"type":"string"},"cidade":{"type":"string"},"estado":{"type":"string"},"pais":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"lgpdConsentAt":{"type":["string","null"]},"lgpdSource":{"type":["string","null"]},"updatedAt":{"type":"string"},"possibleFraud":{"type":"null"}},"required":["id","name","phone","firstSeenAt","origin","code","email","emailStatus","instagram","telegram","document","temperature","temperatureBand","temperatureTrend","temperatureUpdatedAt","score","scoreTier","openOpportunities","isCustomer","lastActivityAt","channels","tags","systemTags","customFields","emailSecondary","linkedin","profession","language","gender","birthday","city","state","address","lgpdConsentAt","lgpdSource","updatedAt","possibleFraud"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":"number"}},"required":["items","nextCursor","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.get":{"post":{"operationId":"contacts.get","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.get.md"},"x-mcp-tool":"contacts_get","x-cli":"node cli/atomiks.mjs contacts.get --json '{...}'","x-session-only":false,"summary":"Ver um contato e sua origem","description":"Contato com a origem completa (primeira indicação de anúncio e o anúncio resolvido: nomes, criativo, `permalinkUrl`, `previewLink`, `lookupStatus`) e todas as indicações do contato, da mais antiga à mais nova. Com `lookupStatus` diferente de `ok` só os dados que vieram na mensagem são confiáveis (título, texto, imagem, `sourceUrl`).","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"waId":{"type":"string"},"firstSeenAt":{"type":"string"},"origin":{"type":"object","properties":{"kind":{"type":"string","enum":["ad","organic"]},"referral":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":["string","null"]},"sourceType":{"type":["string","null"]},"sourceUrl":{"type":["string","null"]},"headline":{"type":["string","null"]},"body":{"type":["string","null"]},"mediaType":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"videoUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"ctwaClid":{"type":["string","null"]},"welcomeMessage":{"type":["string","null"]},"channelId":{"type":"string"},"receivedAt":{"type":"string"}},"required":["id","sourceId","sourceType","sourceUrl","headline","body","mediaType","imageUrl","videoUrl","thumbnailUrl","ctwaClid","welcomeMessage","channelId","receivedAt"],"additionalProperties":false},{"type":"null"}]},"ad":{"anyOf":[{"type":"object","properties":{"adId":{"type":["string","null"]},"name":{"type":["string","null"]},"adsetName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"status":{"type":["string","null"]},"creative":{"anyOf":[{},{"type":"null"}]},"permalinkUrl":{"type":["string","null"]},"previewLink":{"type":["string","null"]},"lookupStatus":{"type":"string","enum":["pending","ok","not_matched","error"]},"lookupError":{"type":["string","null"]}},"required":["adId","name","adsetName","campaignName","status","creative","permalinkUrl","previewLink","lookupStatus","lookupError"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","referral","ad"],"additionalProperties":false},"referrals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":["string","null"]},"sourceType":{"type":["string","null"]},"sourceUrl":{"type":["string","null"]},"headline":{"type":["string","null"]},"body":{"type":["string","null"]},"mediaType":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"videoUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"ctwaClid":{"type":["string","null"]},"welcomeMessage":{"type":["string","null"]},"channelId":{"type":"string"},"receivedAt":{"type":"string"}},"required":["id","sourceId","sourceType","sourceUrl","headline","body","mediaType","imageUrl","videoUrl","thumbnailUrl","ctwaClid","welcomeMessage","channelId","receivedAt"],"additionalProperties":false}}},"required":["id","name","phone","waId","firstSeenAt","origin","referrals"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.create":{"post":{"operationId":"contacts.create","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.create.md"},"x-mcp-tool":"contacts_create","x-cli":"node cli/atomiks.mjs contacts.create --json '{...}'","x-session-only":false,"summary":"Criar contato","description":"Cria um contato com nome e pelo menos um canal: `phone` (só dígitos com DDI, 10 a 15; `+`, espaços e traços são ignorados), `email` ou `instagram` (o @ do perfil). Canal informado e inválido dá `invalid_input`. Origem `manual`; quem cria passa a vê-lo na lista mesmo sem conversa. `tagIds` (tags da conta) são aplicadas sem disparar automações de tag.\n\nIdentidade e duplicado: com telefone, procura pelo telefone; sem telefone, pelo e-mail; só com Instagram, pelo @. Se já existe, devolve o contato existente com `created: false` sem alterar nada (com e-mail, só preenche nome vazio) e sem aplicar as tags.\n\nContato só com e-mail ou Instagram não conversa pelo WhatsApp até ganhar um telefone; o só-Instagram não recebe Direct até a pessoa escrever. Para falar com ele use `inbox.conversation_start`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":40},"email":{"type":"string","maxLength":254},"instagram":{"type":"string","maxLength":100},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["name"]},"example":{"name":"Maria Souza","phone":"+55 11 91234-5678","email":"maria@exemplo.com","instagram":"@mariasouza"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"origin":{"type":"object","properties":{"kind":{"type":"string","enum":["ad","organic","manual","import","integration","instagram","form","api"]},"detail":{"type":["string","null"]},"adId":{"type":["string","null"]},"adName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"headline":{"type":["string","null"]}},"required":["kind","detail","adId","adName","campaignName","headline"],"additionalProperties":false},"created":{"type":"boolean"}},"required":["id","name","phone","firstSeenAt","origin","created"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads.list":{"post":{"operationId":"ads.list","tags":["ads"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ads.list.md"},"x-mcp-tool":"ads_list","x-cli":"node cli/atomiks.mjs ads.list --json '{...}'","x-session-only":false,"summary":"Listar anúncios que trouxeram pessoas","description":"Anúncios de origem da conta atual com quantas pessoas chegaram por eles. Conta cada contato uma vez, no anúncio da sua primeira indicação. `from` e `to` (data ISO) limitam pela data dessa primeira indicação. Com `lookupStatus` diferente de `ok` os nomes ficam nulos e valem `headline`, `thumbnailUrl` e `permalinkUrl` vindos da mensagem. Ordenado por pessoas.","x-scope":"ads:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","minLength":8,"maxLength":40},"to":{"type":"string","minLength":8,"maxLength":40}}},"example":{"from":"2026-10-01"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"adId":{"type":"string"},"name":{"type":["string","null"]},"adsetName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"headline":{"type":["string","null"]},"people":{"type":"number"},"firstAt":{"type":"string"},"lastAt":{"type":"string"},"thumbnailUrl":{"type":["string","null"]},"permalinkUrl":{"type":["string","null"]},"lookupStatus":{"type":"string","enum":["pending","ok","not_matched","error"]}},"required":["adId","name","adsetName","campaignName","headline","people","firstAt","lastAt","thumbnailUrl","permalinkUrl","lookupStatus"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads.get":{"post":{"operationId":"ads.get","tags":["ads"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ads.get.md"},"x-mcp-tool":"ads_get","x-cli":"node cli/atomiks.mjs ads.get --json '{...}'","x-session-only":false,"summary":"Ver um anúncio e as pessoas que vieram por ele","description":"Anúncio (nomes de anúncio, conjunto e campanha, criativo, `permalinkUrl`, `previewLink`, `lookupStatus`) mais o que veio nas mensagens (`headline`, `body`, `imageUrl`, `sourceUrl`) e até 100 contatos cuja primeira indicação é dele, do mais novo ao mais antigo. `people` é o total.","x-scope":"ads:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adId":{"type":"string","minLength":1,"maxLength":100}},"required":["adId"]},"example":{"adId":"120210000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adId":{"type":"string"},"name":{"type":["string","null"]},"adsetName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"status":{"type":["string","null"]},"creative":{"anyOf":[{},{"type":"null"}]},"permalinkUrl":{"type":["string","null"]},"previewLink":{"type":["string","null"]},"lookupStatus":{"type":"string","enum":["pending","ok","not_matched","error"]},"lookupError":{"type":["string","null"]},"people":{"type":"number"},"headline":{"type":["string","null"]},"body":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"sourceUrl":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"origin":{"type":"object","properties":{"kind":{"type":"string","enum":["ad","organic","manual","import","integration","instagram","form","api"]},"detail":{"type":["string","null"]},"adId":{"type":["string","null"]},"adName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"headline":{"type":["string","null"]}},"required":["kind","detail","adId","adName","campaignName","headline"],"additionalProperties":false}},"required":["id","name","phone","firstSeenAt","origin"],"additionalProperties":false}}},"required":["adId","name","adsetName","campaignName","status","creative","permalinkUrl","previewLink","lookupStatus","lookupError","people","headline","body","imageUrl","thumbnailUrl","sourceUrl","contacts"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads_manager.tree":{"post":{"operationId":"ads_manager.tree","tags":["ads_manager"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ads_manager.tree.md"},"x-mcp-tool":"ads_manager_tree","x-cli":"node cli/atomiks.mjs ads_manager.tree --json '{...}'","x-session-only":false,"summary":"Árvore campanha, conjunto e anúncio com métricas da Meta e reais","description":"Campanhas, conjuntos e anúncios da conta de anúncios conectada, com as métricas da Meta no período (gasto, impressões, cliques, CPM, CTR, CPC, `conversationsMeta` = conversas iniciadas segundo a Meta) ao lado das reais (`conversationsReal` = contatos cuja PRIMEIRA indicação é do anúncio, no dia do fuso da conta; `costPerConversationReal`) e as vendas: `sales` e `revenueCents` (vendas não canceladas do contato cuja PRIMEIRA indicação é do anúncio, com `sold_at` no dia do fuso da conta), `costPerSaleCents` (gasto ÷ vendas, em centavos) e `roas` (receita ÷ gasto). Somas sobem de anúncio para conjunto, campanha e `totals`; razões saem das somas e são `null` sem denominador. Item sem entrega no período aparece com zeros. `from` e `to` são datas `AAAA-MM-DD` (até 93 dias). Orçamentos em centavos. `adAccountId` (`act_...`) e `adAccountName` identificam a conta de anúncios conectada.","x-scope":"ads:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"]},"example":{"from":"2026-10-01","to":"2026-10-07"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currency":{"type":["string","null"]},"timezone":{"type":["string","null"]},"lastSyncedAt":{"type":["string","null"]},"adAccountId":{"type":["string","null"]},"adAccountName":{"type":["string","null"]},"totals":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"cpm":{"type":["number","null"]},"ctr":{"type":["number","null"]},"cpc":{"type":["number","null"]},"conversationsMeta":{"type":"number"},"conversationsReal":{"type":"number"},"costPerConversationReal":{"type":["number","null"]},"sales":{"type":"number"},"revenueCents":{"type":"number"},"costPerSaleCents":{"type":["number","null"]},"roas":{"type":["number","null"]}},"required":["spend","impressions","clicks","cpm","ctr","cpc","conversationsMeta","conversationsReal","costPerConversationReal","sales","revenueCents","costPerSaleCents","roas"],"additionalProperties":false},"campaigns":{"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["currency","timezone","lastSyncedAt","adAccountId","adAccountName","totals","campaigns"],"additionalProperties":false,"$defs":{"__schema0":{"type":"object","properties":{"id":{"type":"string"},"level":{"type":"string","enum":["campaign","adset","ad"]},"name":{"type":["string","null"]},"configuredStatus":{"type":["string","null"]},"effectiveStatus":{"type":["string","null"]},"dailyBudget":{"type":["number","null"]},"lifetimeBudget":{"type":["number","null"]},"metrics":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"cpm":{"type":["number","null"]},"ctr":{"type":["number","null"]},"cpc":{"type":["number","null"]},"conversationsMeta":{"type":"number"},"conversationsReal":{"type":"number"},"costPerConversationReal":{"type":["number","null"]},"sales":{"type":"number"},"revenueCents":{"type":"number"},"costPerSaleCents":{"type":["number","null"]},"roas":{"type":["number","null"]}},"required":["spend","impressions","clicks","cpm","ctr","cpc","conversationsMeta","conversationsReal","costPerConversationReal","sales","revenueCents","costPerSaleCents","roas"],"additionalProperties":false},"children":{"type":"array","items":{"$ref":"#/$defs/__schema0"}}},"required":["id","level","name","configuredStatus","effectiveStatus","dailyBudget","lifetimeBudget","metrics","children"],"additionalProperties":false}}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads_manager.sync":{"post":{"operationId":"ads_manager.sync","tags":["ads_manager"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ads_manager.sync.md"},"x-mcp-tool":"ads_manager_sync","x-cli":"node cli/atomiks.mjs ads_manager.sync --json '{...}'","x-session-only":false,"summary":"Pedir atualização dos dados do gerenciador","description":"Marca a conta para sincronizar no próximo ciclo do worker (estrutura e insights da Meta). Não chama a Meta na hora; leia `lastSyncedAt` em `ads_manager.tree` para saber quando terminou.","x-scope":"ads:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attribution.export":{"post":{"operationId":"attribution.export","tags":["attribution"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attribution.export.md"},"x-mcp-tool":"attribution_export","x-cli":"node cli/atomiks.mjs attribution.export --json '{...}'","x-session-only":false,"summary":"Exportar leads e vendas atribuídos a anúncios (sem dado pessoal)","description":"Para o RealMetrics puxar a atribuição do Atomiks. `kind` `leads`: um item por contato cuja PRIMEIRA indicação de anúncio (com `source_id`) caiu na janela: `{contactId, firstAt, adId, ctwaClid, sourceType}`. `kind` `sales`: um item por venda com `sold_at` na janela, canceladas inclusive (`cancelledAt` preenchido), só de contatos com primeira indicação de anúncio; `adId` é o anúncio dessa primeira indicação: `{saleId, contactId, soldAt, valueCents, cancelledAt, adId}`. `adId` é o id do anúncio na Meta; `valueCents` em centavos de BRL; datas em ISO-8601 com fuso. `from` e `to` são datas `AAAA-MM-DD` (até 93 dias) no fuso da conta de anúncios (`timezone` na saída; padrão America/Sao_Paulo). Itens ordenados por `contactId` (leads) ou `saleId` (vendas). `limit` de 1 a 1000, padrão 500. Paginação: repita a chamada com `cursor` = `nextCursor` até ele vir nulo; página com menos itens que `limit` não significa fim, o fim é `nextCursor` nulo. Cursor adulterado ou de outro `kind` dá `invalid_input`. Nenhum nome, telefone ou e-mail sai por aqui.","x-scope":"ads:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["leads","sales"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cursor":{"type":"string","minLength":1,"maxLength":500},"limit":{"type":"integer","minimum":1,"maximum":1000}},"required":["kind","from","to"]},"example":{"kind":"leads","from":"2026-10-01","to":"2026-10-07"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"contactId":{"type":"string"},"firstAt":{"type":"string"},"adId":{"type":"string"},"ctwaClid":{"type":["string","null"]},"sourceType":{"type":["string","null"]}},"required":["contactId","firstAt","adId","ctwaClid","sourceType"],"additionalProperties":false},{"type":"object","properties":{"saleId":{"type":"string"},"contactId":{"type":"string"},"soldAt":{"type":"string"},"valueCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"cancelledAt":{"type":["string","null"]},"adId":{"type":"string"}},"required":["saleId","contactId","soldAt","valueCents","cancelledAt","adId"],"additionalProperties":false}]}},"nextCursor":{"type":["string","null"]},"timezone":{"type":"string"}},"required":["items","nextCursor","timezone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.conversations_list":{"post":{"operationId":"inbox.conversations_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.conversations_list.md"},"x-mcp-tool":"inbox_conversations_list","x-cli":"node cli/atomiks.mjs inbox.conversations_list --json '{...}'","x-session-only":false,"summary":"Listar conversas da caixa de entrada","description":"Conversas da conta atual, da mais recente à mais antiga, só dos números que o membro pode usar (e, com \"só livres e as próprias\" ligado, só as sem atendente ou do próprio membro). Filtros combinados com E: `tab` (`mine` = atribuídas a mim; `queue` = abertas sem atendente; `all`), `kind` (`direct` = só individuais; `group` = só grupos), `statusIn` (open, assigned, resolved, closed), `channelId`/`channelIdIn`, `priorityIn`, `unread` (mensagens não lidas), `awaitingReply` (última mensagem é do contato), `unreadByMe` (marcada não lida ou com entrada depois da minha leitura), `lastMessageAfter`/`lastMessageBefore` (ISO, inclusivo), `q` (nome, telefone ou ticket como `#000123` ou `123`). `assignedToIn` e `includeUnassigned` são só para administradores. `origin` diz se o contato veio de anúncio. Paginação por `cursor` (devolvido em `nextCursor`). `total` é a contagem de todas as conversas que casam com os filtros (sem o cursor), só na primeira página; nas seguintes é `null`. `viewAsAttendantId` (só admin) faz `tab: mine` valer para aquele atendente.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tab":{"type":"string","enum":["mine","queue","all"]},"kind":{"type":"string","enum":["all","direct","group"]},"statusIn":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["open","assigned","resolved","closed"]}},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelIdIn":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"q":{"type":"string","maxLength":80},"unread":{"type":"boolean"},"awaitingReply":{"type":"boolean"},"unreadByMe":{"type":"boolean"},"assignedToIn":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"includeUnassigned":{"type":"boolean"},"priorityIn":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"lastMessageAfter":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastMessageBefore":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"viewAsAttendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"},"cursor":{"type":"string","maxLength":300},"limit":{"type":"integer","minimum":1,"maximum":50}}},"example":{"tab":"queue","statusIn":["open","assigned"],"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["whatsapp_cloud","whatsapp_web"]},"connectionType":{"anyOf":[{"type":"string","enum":["coexistence","new_number","qr"]},{"type":"null"}]},"webProvider":{"anyOf":[{"type":"string","enum":["evolution","waha"]},{"type":"null"}]},"displayPhone":{"type":["string","null"]},"verifiedName":{"type":["string","null"]}},"required":["id","kind","connectionType","displayPhone","verifiedName"],"additionalProperties":false},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]}},"required":["id","name","phone","avatarUrl"],"additionalProperties":false},"lastMessageAt":{"type":["string","null"]},"lastMessagePreview":{"type":["string","null"]},"lastMessageSender":{"type":["string","null"]},"windowExpiresAt":{"type":["string","null"]},"unreadCount":{"type":"number"},"unreadByMe":{"type":"boolean"},"origin":{"type":"string","enum":["ad","organic"]},"status":{"type":"string","enum":["open","assigned","resolved","closed"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"ticket":{"type":["string","null"]},"mutedByMe":{"type":"boolean"},"pinnedAt":{"type":["string","null"]},"windowState":{"anyOf":[{"type":"string","enum":["open","closing","closed"]},{"type":"null"}]},"isGroup":{"type":"boolean"},"groupSubject":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"blockedAt":{"type":["string","null"]},"unreadMentionId":{"type":["string","null"]}},"required":["id","channel","contact","lastMessageAt","lastMessagePreview","windowExpiresAt","unreadCount","unreadByMe","origin","status","priority","assignee","ticket","mutedByMe","windowState","isGroup","groupSubject"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":["number","null"]}},"required":["items","nextCursor","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.unread_count":{"post":{"operationId":"inbox.unread_count","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.unread_count.md"},"x-mcp-tool":"inbox_unread_count","x-cli":"node cli/atomiks.mjs inbox.unread_count --json '{...}'","x-session-only":false,"summary":"Total de conversas não lidas (badge do menu)","description":"Quantas conversas abertas ou em atendimento, entre as que o membro enxerga, têm mensagens não lidas. Arquivadas não entram. `archivedCount` = total de conversas arquivadas. Contagem direta no banco, barata para consultar a cada minuto.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"},"archivedCount":{"type":"number"}},"required":["count","archivedCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.conversation_get":{"post":{"operationId":"inbox.conversation_get","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.conversation_get.md"},"x-mcp-tool":"inbox_conversation_get","x-cli":"node cli/atomiks.mjs inbox.conversation_get --json '{...}'","x-session-only":false,"summary":"Ver uma conversa e a origem do lead","description":"Conversa com contato, número de atendimento, janela de 24 h (`windowExpiresAt`) e a origem completa do lead (`origin.kind`, `referral`, `ad`), na mesma forma de `contacts.get`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["whatsapp_cloud","whatsapp_web"]},"connectionType":{"anyOf":[{"type":"string","enum":["coexistence","new_number","qr"]},{"type":"null"}]},"webProvider":{"anyOf":[{"type":"string","enum":["evolution","waha"]},{"type":"null"}]},"displayPhone":{"type":["string","null"]},"verifiedName":{"type":["string","null"]}},"required":["id","kind","connectionType","displayPhone","verifiedName"],"additionalProperties":false},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]}},"required":["id","name","phone","avatarUrl"],"additionalProperties":false},"lastMessageAt":{"type":["string","null"]},"lastMessagePreview":{"type":["string","null"]},"lastMessageSender":{"type":["string","null"]},"windowExpiresAt":{"type":["string","null"]},"unreadCount":{"type":"number"},"unreadByMe":{"type":"boolean"},"origin":{"type":"object","properties":{"kind":{"type":"string","enum":["ad","organic"]},"referral":{"anyOf":[{},{"type":"null"}]},"ad":{"anyOf":[{},{"type":"null"}]}},"required":["kind","referral","ad"],"additionalProperties":false},"status":{"type":"string","enum":["open","assigned","resolved","closed"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"ticket":{"type":["string","null"]},"mutedByMe":{"type":"boolean"},"pinnedAt":{"type":["string","null"]},"windowState":{"anyOf":[{"type":"string","enum":["open","closing","closed"]},{"type":"null"}]},"isGroup":{"type":"boolean"},"groupSubject":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"blockedAt":{"type":["string","null"]},"unreadMentionId":{"type":["string","null"]},"capabilities":{"type":"object","properties":{"text":{"type":"boolean","const":true},"media":{"type":"array","items":{"type":"string","enum":["image","video","audio","file"]}},"reply":{"type":"boolean"},"reaction":{"type":"boolean"},"deliveryStatus":{"type":"boolean"},"readReceipt":{"type":"boolean"},"windowMs":{"type":["number","null"]},"templates":{"type":"boolean"},"scheduling":{"type":"boolean"},"quickReplies":{"type":"boolean"}},"required":["text","media","reply","reaction","deliveryStatus","readReceipt","windowMs","templates","scheduling","quickReplies"],"additionalProperties":false}},"required":["id","channel","contact","lastMessageAt","lastMessagePreview","windowExpiresAt","unreadCount","unreadByMe","origin","status","priority","assignee","ticket","mutedByMe","windowState","isGroup","groupSubject","capabilities"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.messages_list":{"post":{"operationId":"inbox.messages_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.messages_list.md"},"x-mcp-tool":"inbox_messages_list","x-cli":"node cli/atomiks.mjs inbox.messages_list --json '{...}'","x-session-only":false,"summary":"Listar mensagens de uma conversa","description":"Mensagens de uma conversa em ordem crescente de hora. Sem `before` devolve as mais recentes; para carregar anteriores passe `nextBefore` da resposta em `before`. Cada mensagem traz o estado da mídia (`pending`, `available`, `failed`, `expired`) e quem enviou. A mídia é lida por `GET /api/v1/media/:id`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"type":"string","maxLength":300},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.mark_read":{"post":{"operationId":"inbox.mark_read","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.mark_read.md"},"x-mcp-tool":"inbox_mark_read","x-cli":"node cli/atomiks.mjs inbox.mark_read --json '{...}'","x-session-only":false,"summary":"Marcar conversa como lida","description":"Zera as mensagens não lidas da conversa e a marca \"não lida\" manual do usuário. Só funciona em conversa de número que o membro pode usar.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.send":{"post":{"operationId":"inbox.send","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.send.md"},"x-mcp-tool":"inbox_send","x-cli":"node cli/atomiks.mjs inbox.send --json '{...}'","x-session-only":false,"summary":"Enviar mensagem em uma conversa","description":"Envia texto, mídia (`uploadId` de `POST /api/v1/uploads`), figurinha da biblioteca (`stickerId` de `inbox.stickers_list`, só WhatsApp) ou modelo aprovado (`templateId` + `params`) pelo número da conversa. Informe exatamente um entre `text`, `uploadId`, `stickerId` e `templateId`. `clientRequestId` torna o pedido idempotente: repetir devolve a mensagem original. `replyToMessageId` cita uma mensagem da mesma conversa. Fora da janela de 24 h só modelo. Resposta incerta da Meta deixa a mensagem `unknown` (`uncertain: true`) e nada é reenviado.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientRequestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":4096},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":"string","maxLength":1024},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":2048}},"stickerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"replyToMessageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId","clientRequestId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","clientRequestId":"6f1c2b0e-8a4d-4c3b-9e2f-1a2b3c4d5e6f","text":"Olá!"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false},"uncertain":{"type":"boolean"}},"required":["message","uncertain"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.templates_list":{"post":{"operationId":"inbox.templates_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.templates_list.md"},"x-mcp-tool":"inbox_templates_list","x-cli":"node cli/atomiks.mjs inbox.templates_list --json '{...}'","x-session-only":false,"summary":"Listar modelos de mensagem do WhatsApp","description":"Modelos da Meta de um número, com texto, campos a preencher e se o Atomiks consegue enviar cada um (modelos com mídia no cabeçalho ou botão com parâmetro não). Sincroniza antes se a última sincronização tem mais de 1 hora.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"syncedAt":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":["string","null"]},"status":{"type":"string"},"body":{"type":"string"},"slots":{"type":"object","properties":{"header":{"type":"boolean"},"body":{"type":"array","items":{"type":"string"}}},"required":["header","body"],"additionalProperties":false},"sendable":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["id","name","language","category","status","body","slots","sendable","reason"],"additionalProperties":false}}},"required":["syncedAt","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.templates_sync":{"post":{"operationId":"inbox.templates_sync","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.templates_sync.md"},"x-mcp-tool":"inbox_templates_sync","x-cli":"node cli/atomiks.mjs inbox.templates_sync --json '{...}'","x-session-only":false,"summary":"Sincronizar modelos de mensagem do WhatsApp","description":"Busca na Meta os modelos do número e atualiza a lista; modelos que sumiram da Meta ficam desativados.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.attendance":{"post":{"operationId":"inbox.attendance","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.attendance.md"},"x-mcp-tool":"inbox_attendance","x-cli":"node cli/atomiks.mjs inbox.attendance --json '{...}'","x-session-only":false,"summary":"Agir no atendimento de uma conversa","description":"Ações: `claim` (assumir), `leave` (devolver à fila), `assign` e `transfer` (para `userId`; só gestor, e a pessoa precisa ter acesso ao número), `resolve`, `reopen`, `set_priority` (`priority`; só gestor). Cada atendimento tem um ticket (`#000123`). Resolver conversa com mensagens agendadas pendentes falha com mensagem iniciada por `scheduled_pending:`; repita com `scheduled: \"cancel\"` ou `\"keep\"`. Assumir ao mesmo tempo: só uma pessoa fica. \"Gestor\" é o admin da conta.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["claim","leave","assign","transfer","resolve","reopen","set_priority"]},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"scheduled":{"type":"string","enum":["cancel","keep"]}},"required":["conversationId","action"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","action":"claim"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"conversation":{}},"required":["id","conversation"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.assignable_members":{"post":{"operationId":"inbox.assignable_members","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.assignable_members.md"},"x-mcp-tool":"inbox_assignable_members","x-cli":"node cli/atomiks.mjs inbox.assignable_members --json '{...}'","x-session-only":false,"summary":"Listar atendentes para atribuir uma conversa","description":"Membros da conta com a quantidade de conversas em andamento (`activeCount`) e se têm acesso ao número da conversa (`allowed`); quem não tem acesso não pode receber a conversa.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]},"activeCount":{"type":"number"},"allowed":{"type":"boolean"}},"required":["userId","name","activeCount","allowed"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.attendance_events":{"post":{"operationId":"inbox.attendance_events","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.attendance_events.md"},"x-mcp-tool":"inbox_attendance_events","x-cli":"node cli/atomiks.mjs inbox.attendance_events --json '{...}'","x-session-only":false,"summary":"Histórico de atendimento de uma conversa","description":"Últimos eventos (atribuição, transferência, devolução, resolução, reabertura, prioridade) com nomes e o ticket do atendimento.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"createdAt":{"type":"string"},"ticket":{"type":["string","null"]},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"from":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"by":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","action","createdAt","ticket","user","from","by"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.note_create":{"post":{"operationId":"inbox.note_create","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.note_create.md"},"x-mcp-tool":"inbox_note_create","x-cli":"node cli/atomiks.mjs inbox.note_create --json '{...}'","x-session-only":false,"summary":"Criar nota interna em uma conversa","description":"Nota só da equipe (o contato nunca vê nem recebe). `parentNoteId` responde a outra nota da mesma conversa.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":4096},"parentNoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId","body"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","body":"Cliente pediu retorno amanhã"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentNoteId":{"type":["string","null"]},"body":{"type":["string","null"]},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"repliesCount":{"type":"number"}},"required":["id","conversationId","parentNoteId","body","author","createdAt","edited","deleted","repliesCount"],"additionalProperties":false}},"required":["note"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.note_update":{"post":{"operationId":"inbox.note_update","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.note_update.md"},"x-mcp-tool":"inbox_note_update","x-cli":"node cli/atomiks.mjs inbox.note_update --json '{...}'","x-session-only":false,"summary":"Editar nota interna","description":"Só o autor edita; a nota passa a mostrar \"editada\". Nota removida não pode ser editada.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":4096}},"required":["id","body"]},"example":{"id":"00000000-0000-0000-0000-000000000000","body":"Texto corrigido"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentNoteId":{"type":["string","null"]},"body":{"type":["string","null"]},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"repliesCount":{"type":"number"}},"required":["id","conversationId","parentNoteId","body","author","createdAt","edited","deleted","repliesCount"],"additionalProperties":false}},"required":["note"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.note_delete":{"post":{"operationId":"inbox.note_delete","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.note_delete.md"},"x-mcp-tool":"inbox_note_delete","x-cli":"node cli/atomiks.mjs inbox.note_delete --json '{...}'","x-session-only":false,"summary":"Remover nota interna","description":"O autor ou um administrador remove a nota; ela fica na conversa como \"Nota removida\", sem o texto.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentNoteId":{"type":["string","null"]},"body":{"type":["string","null"]},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"repliesCount":{"type":"number"}},"required":["id","conversationId","parentNoteId","body","author","createdAt","edited","deleted","repliesCount"],"additionalProperties":false}},"required":["note"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.notes_list":{"post":{"operationId":"inbox.notes_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.notes_list.md"},"x-mcp-tool":"inbox_notes_list","x-cli":"node cli/atomiks.mjs inbox.notes_list --json '{...}'","x-session-only":false,"summary":"Listar notas internas","description":"Notas e respostas da conta em ordem crescente de hora (as mais recentes quando passa de `limit`, padrão 100). Filtros: `conversationId`, `q` (texto), `userId` (autor), `from`/`to` (data ISO). Traz autor, quantidade de respostas e se foi editada ou removida.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":80},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"limit":{"type":"integer","minimum":1,"maximum":200}}},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentNoteId":{"type":["string","null"]},"body":{"type":["string","null"]},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"repliesCount":{"type":"number"}},"required":["id","conversationId","parentNoteId","body","author","createdAt","edited","deleted","repliesCount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.quick_replies_list":{"post":{"operationId":"inbox.quick_replies_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.quick_replies_list.md"},"x-mcp-tool":"inbox_quick_replies_list","x-cli":"node cli/atomiks.mjs inbox.quick_replies_list --json '{...}'","x-session-only":false,"summary":"Listar respostas rápidas","description":"Respostas rápidas da conta, por ordem de nome. `q` filtra por nome ou atalho, sem diferenciar maiúsculas.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":100},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{"q":"ola"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortcut":{"type":["string","null"]},"body":{"type":"string"},"uploadId":{"type":["string","null"]},"updatedAt":{"type":"string"},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"type":{"type":"string","enum":["text","interactive"]},"contents":{"type":"object","properties":{"header":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image","video","document"]},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","maxLength":255}},"required":["kind","uploadId"],"additionalProperties":false}]},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"label":{"type":"string","minLength":1,"maxLength":20}},"required":["kind","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"label":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"}},"required":["kind","label","url"],"additionalProperties":false}]}}},"additionalProperties":false},"usesVariables":{"type":"boolean"},"sendMode":{"anyOf":[{"type":"string","enum":["interactive","numbered_list","text"]},{"type":"null"}]}},"required":["id","name","shortcut","body","uploadId","updatedAt","channelKind","type","contents","usesVariables","sendMode"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.quick_reply_create":{"post":{"operationId":"inbox.quick_reply_create","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.quick_reply_create.md"},"x-mcp-tool":"inbox_quick_reply_create","x-cli":"node cli/atomiks.mjs inbox.quick_reply_create --json '{...}'","x-session-only":false,"summary":"Criar resposta rápida","description":"Cria uma resposta rápida com nome, texto (até 1024) e atalho opcional, único na conta, sem espaço nem barra. `type: \"interactive\"` exige `contents.buttons` (até 3 de resposta, ou 1 de link https; não combinam) e aceita `contents.header` de texto (até 60) e `contents.footer` (até 60); títulos de botão até 20. `channelKind` limita a um canal (null = todos). Variáveis no texto: {nome}, {primeiro_nome}, {telefone}, {email}, {atendente}. Anexo e cabeçalho de mídia ainda não são suportados.","x-scope":"messages:manage","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"shortcut":{"anyOf":[{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\s/]+$"},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":1024},"uploadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"type":{"type":"string","enum":["text","interactive"]},"contents":{"type":"object","properties":{"header":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image","video","document"]},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","maxLength":255}},"required":["kind","uploadId"],"additionalProperties":false}]},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"label":{"type":"string","minLength":1,"maxLength":20}},"required":["kind","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"label":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"}},"required":["kind","label","url"],"additionalProperties":false}]}}},"additionalProperties":false}},"required":["name","body"]},"example":{"name":"Saudação","shortcut":"ola","body":"Olá! Como posso ajudar?"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortcut":{"type":["string","null"]},"body":{"type":"string"},"uploadId":{"type":["string","null"]},"updatedAt":{"type":"string"},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"type":{"type":"string","enum":["text","interactive"]},"contents":{"type":"object","properties":{"header":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image","video","document"]},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","maxLength":255}},"required":["kind","uploadId"],"additionalProperties":false}]},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"label":{"type":"string","minLength":1,"maxLength":20}},"required":["kind","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"label":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"}},"required":["kind","label","url"],"additionalProperties":false}]}}},"additionalProperties":false},"usesVariables":{"type":"boolean"}},"required":["id","name","shortcut","body","uploadId","updatedAt","channelKind","type","contents","usesVariables"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.quick_reply_update":{"post":{"operationId":"inbox.quick_reply_update","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.quick_reply_update.md"},"x-mcp-tool":"inbox_quick_reply_update","x-cli":"node cli/atomiks.mjs inbox.quick_reply_update --json '{...}'","x-session-only":false,"summary":"Alterar resposta rápida","description":"Altera nome, atalho (`null` remove) ou texto de uma resposta rápida. Campos omitidos não mudam.","x-scope":"messages:manage","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"shortcut":{"anyOf":[{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^\\s/]+$"},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":1024},"uploadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"type":{"type":"string","enum":["text","interactive"]},"contents":{"type":"object","properties":{"header":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image","video","document"]},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","maxLength":255}},"required":["kind","uploadId"],"additionalProperties":false}]},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"label":{"type":"string","minLength":1,"maxLength":20}},"required":["kind","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"label":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"}},"required":["kind","label","url"],"additionalProperties":false}]}}},"additionalProperties":false}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","body":"Olá! Em que posso ajudar?"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortcut":{"type":["string","null"]},"body":{"type":"string"},"uploadId":{"type":["string","null"]},"updatedAt":{"type":"string"},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"type":{"type":"string","enum":["text","interactive"]},"contents":{"type":"object","properties":{"header":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":60}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["image","video","document"]},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","maxLength":255}},"required":["kind","uploadId"],"additionalProperties":false}]},"footer":{"type":"string","minLength":1,"maxLength":60},"buttons":{"minItems":1,"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"reply"},"label":{"type":"string","minLength":1,"maxLength":20}},"required":["kind","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"url"},"label":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"}},"required":["kind","label","url"],"additionalProperties":false}]}}},"additionalProperties":false},"usesVariables":{"type":"boolean"}},"required":["id","name","shortcut","body","uploadId","updatedAt","channelKind","type","contents","usesVariables"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.quick_reply_delete":{"post":{"operationId":"inbox.quick_reply_delete","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.quick_reply_delete.md"},"x-mcp-tool":"inbox_quick_reply_delete","x-cli":"node cli/atomiks.mjs inbox.quick_reply_delete --json '{...}'","x-session-only":false,"summary":"Excluir resposta rápida","description":"Exclui a resposta rápida para toda a conta.","x-scope":"messages:manage","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.quick_reply_send":{"post":{"operationId":"inbox.quick_reply_send","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.quick_reply_send.md"},"x-mcp-tool":"inbox_quick_reply_send","x-cli":"node cli/atomiks.mjs inbox.quick_reply_send --json '{...}'","x-session-only":false,"summary":"Enviar uma resposta rápida na conversa","description":"Resolve as variáveis e envia pelo canal da conversa. Cloud API (whatsapp_cloud/gupshup), janela aberta: mensagem interativa nativa (`mode: \"interactive\"`, botões de resposta ou de link; salva como texto com `payload.interactive`). Evolution, Instagram e Telegram: texto com opções numeradas (`mode: \"numbered_list\"`). Tipo texto: texto simples. Janela de 24 h fechada recusa (WhatsApp oficial e Instagram). Resposta rápida de outro canal recusa.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quickReplyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientRequestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId","quickReplyId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","quickReplyId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false},"uncertain":{"type":"boolean"},"mode":{"type":"string","enum":["interactive","numbered_list","text"]}},"required":["message","uncertain","mode"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.archive":{"post":{"operationId":"inbox.archive","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.archive.md"},"x-mcp-tool":"inbox_archive","x-cli":"node cli/atomiks.mjs inbox.archive --json '{...}'","x-session-only":false,"summary":"Arquivar ou desarquivar uma conversa","description":"Tira a conversa da lista comum (`archived: true`) ou a devolve (`false`). Qualquer membro que possa escrever na conversa. Em número por QR code também arquiva no WhatsApp (melhor esforço: se o servidor do número falhar, a conversa fica arquivada só no Atomiks e `synced` vem `false`). Mensagem nova não desarquiva, como no WhatsApp.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"}},"required":["conversationId","archived"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","archived":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true},"archivedAt":{"type":["string","null"]},"synced":{"type":"boolean"}},"required":["ok","archivedAt","synced"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.react":{"post":{"operationId":"inbox.react","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.react.md"},"x-mcp-tool":"inbox_react","x-cli":"node cli/atomiks.mjs inbox.react --json '{...}'","x-session-only":false,"summary":"Reagir a uma mensagem","description":"Reação da equipe (qualquer membro que possa escrever na conversa, não só o atendente ativo) a uma mensagem do contato ou enviada, com um de 👍 ❤️ ✅ 🙏 👏. Vai ao WhatsApp pela Meta. Uma reação por pessoa por mensagem: trocar substitui, `emoji: \"\"` remove. Só canais com reação e mensagens que a Meta já aceitou.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"emoji":{"type":"string","enum":["👍","❤️","✅","🙏","👏",""]}},"required":["messageId","emoji"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000","emoji":"👍"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.edit":{"post":{"operationId":"inbox.edit","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.edit.md"},"x-mcp-tool":"inbox_edit","x-cli":"node cli/atomiks.mjs inbox.edit --json '{...}'","x-session-only":false,"summary":"Editar o texto de uma mensagem enviada","description":"Troca o texto de uma mensagem de texto enviada pelo número (pelo atendimento ou pelo celular), como o \"Editar\" do WhatsApp: o contato vê a mensagem marcada como editada. Só número por QR code e até 15 min depois do envio. Texto de até 4.096 caracteres.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["messageId","text"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000","text":"Texto corrigido"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.button_reply":{"post":{"operationId":"inbox.button_reply","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.button_reply.md"},"x-mcp-tool":"inbox_button_reply","x-cli":"node cli/atomiks.mjs inbox.button_reply --json '{...}'","x-session-only":false,"summary":"Tocar em um botão de resposta de uma mensagem recebida","description":"Faz o toque no botão como o WhatsApp: envia a resposta de botão (`templateButtonReplyMessage` ou `buttonsResponseMessage`, com o id do botão e a citação da mensagem), não um texto. Só número por QR code, em mensagem recebida de modelo ou de botões; `buttonId` é o id do botão na mensagem (`ACT::...`). Se o servidor do número ainda não tem o toque em botão, devolve erro claro.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"buttonId":{"type":"string","minLength":1,"maxLength":200}},"required":["messageId","buttonId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000","buttonId":"ACT::0000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.favorite":{"post":{"operationId":"inbox.favorite","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.favorite.md"},"x-mcp-tool":"inbox_favorite","x-cli":"node cli/atomiks.mjs inbox.favorite --json '{...}'","x-session-only":false,"summary":"Favoritar ou desfavoritar uma mensagem","description":"Favorita é pessoal: só quem favoritou vê. Notas internas não entram.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"on":{"type":"boolean"}},"required":["messageId","on"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000","on":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.favorites_list":{"post":{"operationId":"inbox.favorites_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.favorites_list.md"},"x-mcp-tool":"inbox_favorites_list","x-cli":"node cli/atomiks.mjs inbox.favorites_list --json '{...}'","x-session-only":false,"summary":"Listar mensagens favoritas","description":"Favoritas do usuário, da mais recente favoritada à mais antiga (até 100), de uma conversa (`conversationId`) ou de todas. `q` filtra pelo texto.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":80}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]},"conversation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"channel":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"}},"required":["id","kind"],"additionalProperties":false}},"required":["id","contact","channel"],"additionalProperties":false},{"type":"null"}]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid","conversation"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.forward":{"post":{"operationId":"inbox.forward","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.forward.md"},"x-mcp-tool":"inbox_forward","x-cli":"node cli/atomiks.mjs inbox.forward --json '{...}'","x-session-only":false,"summary":"Encaminhar uma mensagem para outra conversa","description":"Envia o texto ou a mídia (imagem, vídeo, áudio, documento) de uma mensagem para outra conversa, que precisa estar com a janela de 24 h aberta. Nota interna, modelo e mídia indisponível não encaminham. A cópia fica marcada como encaminhada.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId","conversationId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000","conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false},"uncertain":{"type":"boolean"}},"required":["message","uncertain"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.mute":{"post":{"operationId":"inbox.mute","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.mute.md"},"x-mcp-tool":"inbox_mute","x-cli":"node cli/atomiks.mjs inbox.mute --json '{...}'","x-session-only":false,"summary":"Silenciar ou reativar uma conversa","description":"Silenciar é pessoal: tira som e aviso de mensagem nova só para quem silenciou. Não mexe nas não lidas.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"on":{"type":"boolean"}},"required":["conversationId","on"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","on":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.pin":{"post":{"operationId":"inbox.pin","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.pin.md"},"x-mcp-tool":"inbox_pin","x-cli":"node cli/atomiks.mjs inbox.pin --json '{...}'","x-session-only":false,"summary":"Fixar ou desafixar uma conversa no topo da lista","description":"Fixar é pessoal: a conversa fica no topo da sua lista, sem mudar a lista dos outros atendentes.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"on":{"type":"boolean"}},"required":["conversationId","on"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","on":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true},"pinnedAt":{"type":["string","null"]}},"required":["ok","pinnedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.mark_unread":{"post":{"operationId":"inbox.mark_unread","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.mark_unread.md"},"x-mcp-tool":"inbox_mark_unread","x-cli":"node cli/atomiks.mjs inbox.mark_unread --json '{...}'","x-session-only":false,"summary":"Marcar conversa como não lida","description":"Marca como não lida só para você; a contagem de não lidas da conversa não muda. `inbox.mark_read` limpa a marca.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.stickers_list":{"post":{"operationId":"inbox.stickers_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.stickers_list.md"},"x-mcp-tool":"inbox_stickers_list","x-cli":"node cli/atomiks.mjs inbox.stickers_list --json '{...}'","x-session-only":false,"summary":"Listar figurinhas","description":"Biblioteca pessoal de figurinhas do usuário, até 120. `filter: \"recent\"` (padrão) mostra da mais recente usada ou criada à mais antiga; `\"favorites\"` só as favoritas. `url` é assinada e vale 1 hora.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filter":{"type":"string","enum":["recent","favorites"]}}},"example":{"filter":"favorites"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"favorite":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"sizeBytes":{"type":"number"},"url":{"type":"string"}},"required":["id","favorite","lastUsedAt","sizeBytes","url"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.sticker_create":{"post":{"operationId":"inbox.sticker_create","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.sticker_create.md"},"x-mcp-tool":"inbox_sticker_create","x-cli":"node cli/atomiks.mjs inbox.sticker_create --json '{...}'","x-session-only":false,"summary":"Criar figurinha","description":"Adiciona à biblioteca a imagem enviada por `POST /api/v1/uploads` com `kind=sticker` (WebP, PNG ou JPEG até 5 MB; o servidor converte em WebP 512x512 de até 100 KB). A mesma imagem não duplica. `favorite: true` já a favorita.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"favorite":{"type":"boolean"}},"required":["uploadId"]},"example":{"uploadId":"00000000-0000-0000-0000-000000000000","favorite":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"favorite":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"sizeBytes":{"type":"number"},"url":{"type":"string"}},"required":["id","favorite","lastUsedAt","sizeBytes","url"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.sticker_save":{"post":{"operationId":"inbox.sticker_save","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.sticker_save.md"},"x-mcp-tool":"inbox_sticker_save","x-cli":"node cli/atomiks.mjs inbox.sticker_save --json '{...}'","x-session-only":false,"summary":"Salvar figurinha de uma mensagem","description":"Guarda na biblioteca do usuário a figurinha de uma mensagem do chat (recebida ou enviada), já como favorita. Só mensagens `sticker` com a mídia disponível.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"favorite":{"type":"boolean"},"lastUsedAt":{"type":["string","null"]},"sizeBytes":{"type":"number"},"url":{"type":"string"}},"required":["id","favorite","lastUsedAt","sizeBytes","url"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.sticker_favorite":{"post":{"operationId":"inbox.sticker_favorite","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.sticker_favorite.md"},"x-mcp-tool":"inbox_sticker_favorite","x-cli":"node cli/atomiks.mjs inbox.sticker_favorite --json '{...}'","x-session-only":false,"summary":"Favoritar ou desfavoritar figurinha","description":"Favoritar é pessoal. A figurinha continua nos recentes ao desfavoritar.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"on":{"type":"boolean"}},"required":["id","on"]},"example":{"id":"00000000-0000-0000-0000-000000000000","on":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.sticker_delete":{"post":{"operationId":"inbox.sticker_delete","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.sticker_delete.md"},"x-mcp-tool":"inbox_sticker_delete","x-cli":"node cli/atomiks.mjs inbox.sticker_delete --json '{...}'","x-session-only":false,"summary":"Excluir figurinha","description":"Remove da biblioteca do usuário (recentes e favoritas). Mensagens já enviadas com ela não mudam.","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.settings_get":{"post":{"operationId":"inbox.settings_get","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.settings_get.md"},"x-mcp-tool":"inbox_settings_get","x-cli":"node cli/atomiks.mjs inbox.settings_get --json '{...}'","x-session-only":false,"summary":"Ver configurações do atendimento","description":"Configurações da caixa: restringir atendentes a conversas livres e próprias, encerramento automático por inatividade (minutos, `null` desligado) e aparência (presets do balão enviado e do fundo). Sem registro, devolve os padrões.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"restrictToFreeAndOwn":{"type":"boolean"},"autoCloseMinutes":{"type":["number","null"]},"appearance":{"type":"object","properties":{"sentBubble":{"type":"object","properties":{"whatsapp":{"type":"string","enum":["default","accent","graphite","sky","sand"]},"other":{"type":"string","enum":["default","accent","graphite","sky","sand"]}},"required":["whatsapp","other"],"additionalProperties":false},"background":{"type":"string","enum":["none","pattern","solid"]}},"required":["sentBubble","background"],"additionalProperties":false}},"required":["restrictToFreeAndOwn","autoCloseMinutes","appearance"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.settings_update":{"post":{"operationId":"inbox.settings_update","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.settings_update.md"},"x-mcp-tool":"inbox_settings_update","x-cli":"node cli/atomiks.mjs inbox.settings_update --json '{...}'","x-session-only":false,"summary":"Alterar configurações do atendimento","description":"Altera as configurações da caixa. Campos omitidos não mudam. `autoCloseMinutes` é `null` (desliga) ou de 5 a 10080. Presets do balão: default, accent, graphite, sky, sand. Fundo: none, pattern, solid.","x-scope":"messages:manage","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"restrictToFreeAndOwn":{"type":"boolean"},"autoCloseMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":10080},{"type":"null"}]},"appearance":{"type":"object","properties":{"sentBubble":{"type":"object","properties":{"whatsapp":{"type":"string","enum":["default","accent","graphite","sky","sand"]},"other":{"type":"string","enum":["default","accent","graphite","sky","sand"]}}},"background":{"type":"string","enum":["none","pattern","solid"]}}}}},"example":{"autoCloseMinutes":60,"appearance":{"background":"solid"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"restrictToFreeAndOwn":{"type":"boolean"},"autoCloseMinutes":{"type":["number","null"]},"appearance":{"type":"object","properties":{"sentBubble":{"type":"object","properties":{"whatsapp":{"type":"string","enum":["default","accent","graphite","sky","sand"]},"other":{"type":"string","enum":["default","accent","graphite","sky","sand"]}},"required":["whatsapp","other"],"additionalProperties":false},"background":{"type":"string","enum":["none","pattern","solid"]}},"required":["sentBubble","background"],"additionalProperties":false}},"required":["restrictToFreeAndOwn","autoCloseMinutes","appearance"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.prefs_get":{"post":{"operationId":"inbox.prefs_get","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.prefs_get.md"},"x-mcp-tool":"inbox_prefs_get","x-cli":"node cli/atomiks.mjs inbox.prefs_get --json '{...}'","x-session-only":false,"summary":"Ver minhas preferências de aviso","description":"Preferências de aviso do próprio usuário: som, escopo (`all`, `mine_free`, `mine`), aviso no app, matriz de avisos (`notifyAssigned`, `notifyDisconnected`, `notifyTaskAssigned` no app; `pushNewMessage`, `pushAssigned`, `pushDisconnected`, `pushTaskAssigned` no push), chave geral por canal (`allInApp`, `allPush`: desligada, nenhum aviso sai por ele) e presença (`online`). Valem em todas as contas.","x-scope":"messages:read","x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sound":{"type":"boolean"},"notifyScope":{"type":"string","enum":["all","mine_free","mine"]},"inApp":{"type":"boolean"},"notifyAssigned":{"type":"boolean"},"notifyDisconnected":{"type":"boolean"},"pushNewMessage":{"type":"boolean"},"pushAssigned":{"type":"boolean"},"pushDisconnected":{"type":"boolean"},"online":{"type":"boolean"},"allInApp":{"type":"boolean"},"allPush":{"type":"boolean"},"notifyTaskAssigned":{"type":"boolean"},"pushTaskAssigned":{"type":"boolean"}},"required":["sound","notifyScope","inApp","notifyAssigned","notifyDisconnected","pushNewMessage","pushAssigned","pushDisconnected","online","allInApp","allPush","notifyTaskAssigned","pushTaskAssigned"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.prefs_update":{"post":{"operationId":"inbox.prefs_update","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.prefs_update.md"},"x-mcp-tool":"inbox_prefs_update","x-cli":"node cli/atomiks.mjs inbox.prefs_update --json '{...}'","x-session-only":false,"summary":"Alterar minhas preferências de aviso","description":"Altera som, escopo, avisos (app e push) e presença do próprio usuário. Campos omitidos não mudam.","x-scope":"messages:read","x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sound":{"type":"boolean"},"notifyScope":{"type":"string","enum":["all","mine_free","mine"]},"inApp":{"type":"boolean"},"notifyAssigned":{"type":"boolean"},"notifyDisconnected":{"type":"boolean"},"pushNewMessage":{"type":"boolean"},"pushAssigned":{"type":"boolean"},"pushDisconnected":{"type":"boolean"},"online":{"type":"boolean"},"allInApp":{"type":"boolean"},"allPush":{"type":"boolean"},"notifyTaskAssigned":{"type":"boolean"},"pushTaskAssigned":{"type":"boolean"}}},"example":{"notifyScope":"mine"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sound":{"type":"boolean"},"notifyScope":{"type":"string","enum":["all","mine_free","mine"]},"inApp":{"type":"boolean"},"notifyAssigned":{"type":"boolean"},"notifyDisconnected":{"type":"boolean"},"pushNewMessage":{"type":"boolean"},"pushAssigned":{"type":"boolean"},"pushDisconnected":{"type":"boolean"},"online":{"type":"boolean"},"allInApp":{"type":"boolean"},"allPush":{"type":"boolean"},"notifyTaskAssigned":{"type":"boolean"},"pushTaskAssigned":{"type":"boolean"}},"required":["sound","notifyScope","inApp","notifyAssigned","notifyDisconnected","pushNewMessage","pushAssigned","pushDisconnected","online","allInApp","allPush","notifyTaskAssigned","pushTaskAssigned"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.schedule":{"post":{"operationId":"inbox.schedule","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.schedule.md"},"x-mcp-tool":"inbox_schedule","x-cli":"node cli/atomiks.mjs inbox.schedule --json '{...}'","x-session-only":false,"summary":"Agendar mensagens em uma conversa","description":"Agenda de 1 a 5 itens (texto até 4096 ou arquivo de `POST /api/v1/uploads`, com legenda opcional) para `scheduledAt` (ISO, de 30 s a 30 dias à frente). O worker envia no horário, só com a janela de 24 h aberta; senão a agendada falha com o motivo. Um arquivo + um texto sai como arquivo com legenda. Só canais com agendamento. Nota interna não agenda.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scheduledAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"contents":{"minItems":1,"maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"upload"},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":"string","maxLength":1024}},"required":["kind","uploadId"],"additionalProperties":false}]}},"replyToMessageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId","scheduledAt","timezone","contents"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","scheduledAt":"2030-01-01T12:00:00-03:00","timezone":"America/Sao_Paulo","contents":[{"kind":"text","text":"Bom dia!"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.scheduled_list":{"post":{"operationId":"inbox.scheduled_list","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.scheduled_list.md"},"x-mcp-tool":"inbox_scheduled_list","x-cli":"node cli/atomiks.mjs inbox.scheduled_list --json '{...}'","x-session-only":false,"summary":"Listar mensagens agendadas de uma conversa","description":"Agendadas da conversa, da mais próxima à mais distante, com `status` (scheduled, sending, sent, failed, cancelled), `error`, `errorKind`, resumo, autor (`createdByName`) e mensagem citada (`replyTo`). Falhas dispensadas (`inbox.scheduled_dismiss`) não voltam. Até 100.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","sending","sent","failed","cancelled"]},"error":{"type":["string","null"]},"contents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["text","upload"]},"text":{"type":"string"},"caption":{"type":"string"},"uploadId":{"type":"string"}},"required":["kind"],"additionalProperties":false}},"summary":{"type":"string"},"replyToMessageId":{"type":["string","null"]},"sentMessageIds":{"type":"array","items":{"type":"string"}},"createdBy":{"type":["string","null"]},"createdByName":{"type":["string","null"]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"}},"required":["id","body","type"],"additionalProperties":false},{"type":"null"}]},"errorKind":{"anyOf":[{"type":"string","enum":["window_closed","uncertain","rejected","other"]},{"type":"null"}]}},"required":["id","scheduledAt","timezone","status","error","contents","summary","replyToMessageId","sentMessageIds","createdBy","createdByName","replyTo","errorKind"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.scheduled_cancel":{"post":{"operationId":"inbox.scheduled_cancel","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.scheduled_cancel.md"},"x-mcp-tool":"inbox_scheduled_cancel","x-cli":"node cli/atomiks.mjs inbox.scheduled_cancel --json '{...}'","x-session-only":false,"summary":"Cancelar uma mensagem agendada","description":"Cancela uma agendada ainda não enviada (ou falha, para dispensá-la). Já enviada responde `not_found` (\"Já foi enviada\"); em envio, `invalid_input`.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.scheduled_dismiss":{"post":{"operationId":"inbox.scheduled_dismiss","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.scheduled_dismiss.md"},"x-mcp-tool":"inbox_scheduled_dismiss","x-cli":"node cli/atomiks.mjs inbox.scheduled_dismiss --json '{...}'","x-session-only":false,"summary":"Remover uma agendada com falha da lista","description":"Esconde da lista uma agendada com `status` failed (\"Remover da lista\"). Não apaga o registro nem reenvia. Outro status responde `invalid_input`.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.message_error":{"post":{"operationId":"inbox.message_error","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.message_error.md"},"x-mcp-tool":"inbox_message_error","x-cli":"node cli/atomiks.mjs inbox.message_error --json '{...}'","x-session-only":false,"summary":"Causa e ação de uma mensagem que falhou","description":"Para mensagem enviada com `status` failed: `code` da Meta, `text` em pt-BR, `action` sugerida (`send_template` para 131047/131026: janela fechada), `canResend` (falso quando reenviar não adianta) e `resent` (já foi reenviada).","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":["string","null"]},"text":{"type":"string"},"canResend":{"type":"boolean"},"resent":{"type":"boolean"},"status":{"type":["string","null"]},"action":{"type":"string","enum":["reconnect_app","wait_review","rephrase_template","wait_retry","check_recipient","contact_support","send_template","none"]}},"required":["code","text","canResend","resent","status","action"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.resend":{"post":{"operationId":"inbox.resend","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.resend.md"},"x-mcp-tool":"inbox_resend","x-cli":"node cli/atomiks.mjs inbox.resend --json '{...}'","x-session-only":false,"summary":"Reenviar uma mensagem que falhou","description":"Reenvia uma mensagem de WhatsApp com `status` failed (texto ou interativa), com a mesma citação, como mensagem nova marcada `payload.resentFrom`. Uma vez por original: repetir devolve a mesma mensagem. Janela de 24 h fechada (131047/131026) recusa: envie um template. Instagram e outros tipos não reenviam.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false},"uncertain":{"type":"boolean"}},"required":["message","uncertain"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.recover_media":{"post":{"operationId":"inbox.recover_media","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.recover_media.md"},"x-mcp-tool":"inbox_recover_media","x-cli":"node cli/atomiks.mjs inbox.recover_media --json '{...}'","x-session-only":false,"summary":"Baixar de novo a mídia de uma mensagem","description":"Para mídia em `failed` ou `expired`: zera as tentativas e baixa de novo agora (Cloud API pelo id da mídia: recebida vale 7 dias, enviada 30; Evolution pelo `getBase64FromMediaMessage`, recebida ou enviada; Instagram pela URL guardada). Devolve o `state` final; `pending` = nova tentativa agendada. Mídia sem origem guardada (enviada antes desta versão ou pelo Instagram) não se recupera (`invalid_input`).","x-scope":"messages:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["state"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.message_context":{"post":{"operationId":"inbox.message_context","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.message_context.md"},"x-mcp-tool":"inbox_message_context","x-cli":"node cli/atomiks.mjs inbox.message_context --json '{...}'","x-session-only":false,"summary":"Mensagens ao redor de uma mensagem","description":"A mensagem `messageId` com até `before` mensagens antes e `after` depois (padrão 3 e 3, máx. 10), em ordem crescente de hora. Serve ao painel \"Contexto da mensagem\" das favoritas. Notas internas entram como no fio.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"type":"integer","minimum":0,"maximum":10},"after":{"type":"integer","minimum":0,"maximum":10}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"anchorId":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound","outbound_echo","internal","system"]},"source":{"type":"string","enum":["live","history"]},"type":{"type":"string"},"body":{"type":["string","null"]},"status":{"type":["string","null"]},"errorMessage":{"type":["string","null"]},"metaTimestamp":{"type":["string","null"]},"createdAt":{"type":"string"},"sentBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":["string","null"]},"sizeBytes":{"type":["number","null"]},"state":{"type":"string","enum":["pending","available","failed","expired"]}},"required":["id","mimeType","filename","sizeBytes","state"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"type":{"type":"string"},"senderName":{"type":["string","null"]}},"required":["id","body","type","senderName"],"additionalProperties":false},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"mine":{"type":"boolean"},"fromContact":{"type":"boolean"}},"required":["emoji","mine","fromContact"],"additionalProperties":false}},"isFavorited":{"type":"boolean"},"parentNoteId":{"type":["string","null"]},"edited":{"type":"boolean"},"deleted":{"type":"boolean"},"editedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"clientRequestId":{"type":["string","null"]},"scheduled":{"type":"boolean"},"senderName":{"type":["string","null"]},"senderJid":{"type":["string","null"]},"meta":{"anyOf":[{},{"type":"null"}]},"rawType":{"type":["string","null"]},"origin":{"anyOf":[{"type":"string","enum":["phone","automation","flow"]},{"type":"null"}]},"originLabel":{"type":["string","null"]}},"required":["id","conversationId","direction","source","type","body","status","errorMessage","metaTimestamp","createdAt","sentBy","media","payload","replyTo","reactions","isFavorited","parentNoteId","edited","deleted","editedAt","deletedAt","senderName","senderJid"],"additionalProperties":false}}},"required":["anchorId","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.products_list":{"post":{"operationId":"crm.products_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.products_list.md"},"x-mcp-tool":"crm_products_list","x-cli":"node cli/atomiks.mjs crm.products_list --json '{...}'","x-session-only":false,"summary":"Listar produtos","description":"Produtos da conta por ordem de nome. `q` filtra pelo nome; arquivados só com `includeArchived`. Preço em centavos (BRL).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":100},"includeArchived":{"type":"boolean"}}},"example":{"q":"mentoria"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string"},"description":{"type":["string","null"]},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"}},"required":["id","kind","name","description","priceCents","imageUrl","archived"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.product_create":{"post":{"operationId":"crm.product_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.product_create.md"},"x-mcp-tool":"crm_product_create","x-cli":"node cli/atomiks.mjs crm.product_create --json '{...}'","x-session-only":false,"summary":"Criar produto","description":"Cria produto físico, digital ou serviço. O nome é único na conta, sem diferenciar maiúsculas. `priceCents` em centavos.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"priceCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"imageUploadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","name","priceCents"]},"example":{"kind":"digital","name":"Mentoria Pro","priceCents":99700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string"},"description":{"type":["string","null"]},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"}},"required":["id","kind","name","description","priceCents","imageUrl","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.product_update":{"post":{"operationId":"crm.product_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.product_update.md"},"x-mcp-tool":"crm_product_update","x-cli":"node cli/atomiks.mjs crm.product_update --json '{...}'","x-session-only":false,"summary":"Alterar produto","description":"Altera campos do produto. Campos omitidos não mudam; `description: null` limpa.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"priceCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"imageUploadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","priceCents":129700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string"},"description":{"type":["string","null"]},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"}},"required":["id","kind","name","description","priceCents","imageUrl","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.product_archive":{"post":{"operationId":"crm.product_archive","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.product_archive.md"},"x-mcp-tool":"crm_product_archive","x-cli":"node cli/atomiks.mjs crm.product_archive --json '{...}'","x-session-only":false,"summary":"Arquivar produto","description":"Arquiva (`archived: true`) ou restaura o produto. Vendas e oportunidades antigas continuam apontando para ele.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"}},"required":["id","archived"]},"example":{"id":"00000000-0000-0000-0000-000000000000","archived":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["physical","digital","service"]},"name":{"type":"string"},"description":{"type":["string","null"]},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"}},"required":["id","kind","name","description","priceCents","imageUrl","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.pipelines_list":{"post":{"operationId":"crm.pipelines_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.pipelines_list.md"},"x-mcp-tool":"crm_pipelines_list","x-cli":"node cli/atomiks.mjs crm.pipelines_list --json '{...}'","x-session-only":false,"summary":"Listar pipelines com as etapas","description":"Pipelines não arquivadas da conta, cada uma com as etapas em ordem (abertas, depois Ganho e Perdido).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","stages"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.board":{"post":{"operationId":"crm.board","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.board.md"},"x-mcp-tool":"crm_board","x-cli":"node cli/atomiks.mjs crm.board --json '{...}'","x-session-only":false,"summary":"Quadro Kanban de uma pipeline","description":"Pipeline, cards por etapa (`cards[stageId]`, em ordem) e totais por etapa (`count`, `valueCents`). `q` filtra por título, nome ou telefone do contato. Só traz cards de contatos que o chamador pode ver.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":120}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","stages"],"additionalProperties":false},"cards":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"count":{"type":"number"},"valueCents":{"type":"number"}},"required":["count","valueCents"],"additionalProperties":false}},"nextTasks":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"},"assignee":{"type":["string","null"]}},"required":["title","dueAt","kind","assignee"],"additionalProperties":false}}},"required":["pipeline","cards","totals"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunities_list":{"post":{"operationId":"crm.opportunities_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunities_list.md"},"x-mcp-tool":"crm_opportunities_list","x-cli":"node cli/atomiks.mjs crm.opportunities_list --json '{...}'","x-session-only":false,"summary":"Oportunidades de um contato","description":"Todas as oportunidades do contato, da mais recente para a mais antiga.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.pipeline_create":{"post":{"operationId":"crm.pipeline_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.pipeline_create.md"},"x-mcp-tool":"crm_pipeline_create","x-cli":"node cli/atomiks.mjs crm.pipeline_create --json '{...}'","x-session-only":false,"summary":"Criar pipeline","description":"Cria a pipeline com as etapas abertas na ordem dada; o servidor acrescenta \"Ganho\" e \"Perdido\" no fim. A primeira pipeline da conta vira a padrão.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"stages":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}}},"required":["name","stages"]},"example":{"name":"Vendas","stages":["Novo","Em negociação"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","stages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.pipeline_update":{"post":{"operationId":"crm.pipeline_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.pipeline_update.md"},"x-mcp-tool":"crm_pipeline_update","x-cli":"node cli/atomiks.mjs crm.pipeline_update --json '{...}'","x-session-only":false,"summary":"Editar pipeline","description":"Muda nome, grupo ou define como padrão (`isDefault: true`; a antiga padrão deixa de ser). Para trocar o padrão, marque outra pipeline.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"isDefault":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Vendas"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","stages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.pipeline_archive":{"post":{"operationId":"crm.pipeline_archive","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.pipeline_archive.md"},"x-mcp-tool":"crm_pipeline_archive","x-cli":"node cli/atomiks.mjs crm.pipeline_archive --json '{...}'","x-session-only":false,"summary":"Arquivar pipeline","description":"Esconde a pipeline das listas. A pipeline padrão não pode ser arquivada: marque outra como padrão antes.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.stage_upsert":{"post":{"operationId":"crm.stage_upsert","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.stage_upsert.md"},"x-mcp-tool":"crm_stage_upsert","x-cli":"node cli/atomiks.mjs crm.stage_upsert --json '{...}'","x-session-only":false,"summary":"Criar ou mover etapa aberta","description":"Sem `id` cria etapa aberta; com `id` renomeia e/ou reposiciona. `position` é o índice (0 = primeira) entre as etapas abertas; Ganho e Perdido ficam sempre no fim e não podem ser editadas.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":60},"position":{"type":"integer","minimum":0,"maximum":100}},"required":["pipelineId","name","position"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","name":"Proposta","position":1}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.stage_delete":{"post":{"operationId":"crm.stage_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.stage_delete.md"},"x-mcp-tool":"crm_stage_delete","x-cli":"node cli/atomiks.mjs crm.stage_delete --json '{...}'","x-session-only":false,"summary":"Apagar etapa","description":"Só etapas abertas. Ganho/Perdido não se apagam. Com cards: `moveTo` (outra etapa da mesma pipeline) leva todos para o fim dela, `discard: true` apaga os cards; sem nenhum dos dois recusa com \"Mova os cards antes de apagar a etapa\".","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"moveTo":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"discard":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunity_create":{"post":{"operationId":"crm.opportunity_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunity_create.md"},"x-mcp-tool":"crm_opportunity_create","x-cli":"node cli/atomiks.mjs crm.opportunity_create --json '{...}'","x-session-only":false,"summary":"Criar oportunidade","description":"Cria o card do contato. Padrões: pipeline padrão, primeira etapa aberta, título = nome do contato. O contato precisa estar visível ao chamador. Aceita prioridade, previsão de fechamento (AAAA-MM-DD), probabilidade (0-100), origem, empresa (`companyId`). `removeFromOthers: true` apaga as outras oportunidades abertas do contato em outras pipelines.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":120},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"valueCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lostReason":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"removeFromOthers":{"type":"boolean"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunity_update":{"post":{"operationId":"crm.opportunity_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunity_update.md"},"x-mcp-tool":"crm_opportunity_update","x-cli":"node cli/atomiks.mjs crm.opportunity_update --json '{...}'","x-session-only":false,"summary":"Editar oportunidade","description":"Muda título, produto, valor (centavos) ou responsável. `productId`, `valueCents`, `ownerId`, `priority`, `expectedCloseDate`, `probability`, `origin`, `lostReason` e `companyId` aceitam `null` para limpar.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":120},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"valueCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"probability":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lostReason":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"companyId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","valueCents":9700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunity_move":{"post":{"operationId":"crm.opportunity_move","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunity_move.md"},"x-mcp-tool":"crm_opportunity_move","x-cli":"node cli/atomiks.mjs crm.opportunity_move --json '{...}'","x-session-only":false,"summary":"Mover oportunidade de etapa","description":"Move o card para uma etapa da mesma pipeline, antes do card `beforeId` (ou no fim). Ganho/Perdido ajustam `status`, `wonAt`/`lostAt`; `lostReason` só vale ao mover para Perdido.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"beforeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lostReason":{"type":"string","maxLength":200}},"required":["id","stageId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunity_delete":{"post":{"operationId":"crm.opportunity_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunity_delete.md"},"x-mcp-tool":"crm_opportunity_delete","x-cli":"node cli/atomiks.mjs crm.opportunity_delete --json '{...}'","x-session-only":false,"summary":"Apagar oportunidade","description":"Apaga o card. Vendas já registradas continuam, sem o vínculo com a oportunidade.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sales_list":{"post":{"operationId":"crm.sales_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sales_list.md"},"x-mcp-tool":"crm_sales_list","x-cli":"node cli/atomiks.mjs crm.sales_list --json '{...}'","x-session-only":false,"summary":"Listar vendas","description":"Vendas da conta, da mais recente para a mais antiga (50 por página; `cursor` vem de `nextCursor`). Filtros: `contactId`, `from`/`to` (data ISO sobre `soldAt`), `productId`, `source` (manual ou message). Vendas por mensagem trazem a mensagem e a regra de origem.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","enum":["manual","message"]},"cursor":{"type":"string","pattern":"^\\d+$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"valueCents":{"type":"number"},"source":{"type":"string","enum":["manual","message"]},"message":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","body","at"],"additionalProperties":false},{"type":"null"}]},"rule":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"soldAt":{"type":"string"},"cancelled":{"type":"boolean"},"opportunityId":{"type":["string","null"]}},"required":["id","contactId","contact","product","valueCents","source","message","rule","soldAt","cancelled","opportunityId"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_create":{"post":{"operationId":"crm.sale_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_create.md"},"x-mcp-tool":"crm_sale_create","x-cli":"node cli/atomiks.mjs crm.sale_create --json '{...}'","x-session-only":false,"summary":"Registrar venda à mão","description":"Registra uma venda do contato e leva a oportunidade para Ganho (a indicada em `opportunityId`, a aberta mais recente ou uma nova). Sem `valueCents`, usa o preço do produto; sem os dois, recusa.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valueCents":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"soldAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","valueCents":9700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"valueCents":{"type":"number"},"source":{"type":"string","enum":["manual","message"]},"message":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","body","at"],"additionalProperties":false},{"type":"null"}]},"rule":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"soldAt":{"type":"string"},"cancelled":{"type":"boolean"},"opportunityId":{"type":["string","null"]}},"required":["id","contactId","contact","product","valueCents","source","message","rule","soldAt","cancelled","opportunityId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_cancel":{"post":{"operationId":"crm.sale_cancel","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_cancel.md"},"x-mcp-tool":"crm_sale_cancel","x-cli":"node cli/atomiks.mjs crm.sale_cancel --json '{...}'","x-session-only":false,"summary":"Cancelar venda","description":"Marca a venda como cancelada: ela sai das métricas do Gerenciador. A oportunidade não muda. Cancelar de novo não faz nada.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"valueCents":{"type":"number"},"source":{"type":"string","enum":["manual","message"]},"message":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"body":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","body","at"],"additionalProperties":false},{"type":"null"}]},"rule":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"soldAt":{"type":"string"},"cancelled":{"type":"boolean"},"opportunityId":{"type":["string","null"]}},"required":["id","contactId","contact","product","valueCents","source","message","rule","soldAt","cancelled","opportunityId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_rules_list":{"post":{"operationId":"crm.sale_rules_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_rules_list.md"},"x-mcp-tool":"crm_sale_rules_list","x-cli":"node cli/atomiks.mjs crm.sale_rules_list --json '{...}'","x-session-only":false,"summary":"Listar regras de venda automática","description":"Regras que registram uma venda quando uma mensagem enviada pela conta casa com o modelo. Variáveis do modelo: `{produto}` e `{valor}`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"template":{"type":"string"},"productId":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["id","name","template","productId","pipelineId","active"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_rule_create":{"post":{"operationId":"crm.sale_rule_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_rule_create.md"},"x-mcp-tool":"crm_sale_rule_create","x-cli":"node cli/atomiks.mjs crm.sale_rule_create --json '{...}'","x-session-only":false,"summary":"Criar regra de venda automática","description":"Admin. O `template` precisa de `{valor}` ou de `productId`. Ex.: \"Pagamento aprovado de {valor}\".","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"template":{"type":"string","minLength":1,"maxLength":500},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pipelineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"}},"required":["name","template"]},"example":{"name":"Pagamento aprovado","template":"Pagamento aprovado de {valor}"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"template":{"type":"string"},"productId":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["id","name","template","productId","pipelineId","active"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_rule_update":{"post":{"operationId":"crm.sale_rule_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_rule_update.md"},"x-mcp-tool":"crm_sale_rule_update","x-cli":"node cli/atomiks.mjs crm.sale_rule_update --json '{...}'","x-session-only":false,"summary":"Editar regra de venda automática","description":"Admin. Campos omitidos não mudam; `productId` e `pipelineId` aceitam null para limpar.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"template":{"type":"string","minLength":1,"maxLength":500},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pipelineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"active":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","active":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"template":{"type":"string"},"productId":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["id","name","template","productId","pipelineId","active"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.sale_rule_delete":{"post":{"operationId":"crm.sale_rule_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.sale_rule_delete.md"},"x-mcp-tool":"crm_sale_rule_delete","x-cli":"node cli/atomiks.mjs crm.sale_rule_delete --json '{...}'","x-session-only":false,"summary":"Apagar regra de venda automática","description":"Admin. As vendas já registradas pela regra continuam, sem a regra de origem.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tasks_list":{"post":{"operationId":"crm.tasks_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tasks_list.md"},"x-mcp-tool":"crm_tasks_list","x-cli":"node cli/atomiks.mjs crm.tasks_list --json '{...}'","x-session-only":false,"summary":"Listar tarefas","description":"Tarefas dos contatos que o chamador vê. Filtros: `contactId`, `assigneeId` (id ou \"me\"), `bucket` (overdue, today, upcoming, no_date, done; dia no fuso da conta), `q` (título). Até 500.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"me"}]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]},"q":{"type":"string","maxLength":80}}},"example":{"assigneeId":"me","bucket":"today"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"doneAt":{"type":["string","null"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"conversationId":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]},"durationMinutes":{"type":["number","null"]},"allDay":{"type":"boolean"},"notes":{"type":["string","null"]},"meetingUrl":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}}},"required":["id","title","kind","dueAt","done","doneAt","contact","conversationId","opportunityId","assignee","bucket","durationMinutes","allDay","notes","meetingUrl","guests"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tasks_due_count":{"post":{"operationId":"crm.tasks_due_count","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tasks_due_count.md"},"x-mcp-tool":"crm_tasks_due_count","x-cli":"node cli/atomiks.mjs crm.tasks_due_count --json '{...}'","x-session-only":false,"summary":"Contar tarefas atrasadas ou de hoje de uma conversa","description":"Tarefas não feitas, atrasadas ou de hoje (fuso da conta), ligadas à conversa ou ao contato dela.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.task_create":{"post":{"operationId":"crm.task_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.task_create.md"},"x-mcp-tool":"crm_task_create","x-cli":"node cli/atomiks.mjs crm.task_create --json '{...}'","x-session-only":false,"summary":"Criar tarefa","description":"Tarefa de um contato. `assigneeId` precisa ser membro que veja o contato. `kind: meeting` exige `opportunityId`. `notes` é HTML (negrito, itálico, listas, H1-H3): o servidor sanea e descarta o resto. `meetingUrl` só https; `guests` até 10 e-mails (únicos).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"assigneeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"durationMinutes":{"type":"integer","minimum":5,"maximum":1440},"allDay":{"type":"boolean"},"notes":{"type":"string","maxLength":40000},"meetingUrl":{"type":"string","maxLength":500,"pattern":"^https:\\/\\/\\S+$"},"guests":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["contactId","title"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","title":"Ligar para fechar","kind":"call"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"doneAt":{"type":["string","null"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"conversationId":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]},"durationMinutes":{"type":["number","null"]},"allDay":{"type":"boolean"},"notes":{"type":["string","null"]},"meetingUrl":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}}},"required":["id","title","kind","dueAt","done","doneAt","contact","conversationId","opportunityId","assignee","bucket","durationMinutes","allDay","notes","meetingUrl","guests"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.task_update":{"post":{"operationId":"crm.task_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.task_update.md"},"x-mcp-tool":"crm_task_update","x-cli":"node cli/atomiks.mjs crm.task_update --json '{...}'","x-session-only":false,"summary":"Editar tarefa","description":"Altera título, tipo, prazo, responsável, oportunidade, duração, dia inteiro, anotações (HTML saneado), link da reunião e convidados. `dueAt`, `assigneeId`, `opportunityId`, `durationMinutes`, `notes` e `meetingUrl` aceitam null para limpar.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"opportunityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]},"allDay":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":40000},{"type":"null"}]},"meetingUrl":{"anyOf":[{"type":"string","maxLength":500,"pattern":"^https:\\/\\/\\S+$"},{"type":"null"}]},"guests":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","title":"Novo título"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"doneAt":{"type":["string","null"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"conversationId":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]},"durationMinutes":{"type":["number","null"]},"allDay":{"type":"boolean"},"notes":{"type":["string","null"]},"meetingUrl":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}}},"required":["id","title","kind","dueAt","done","doneAt","contact","conversationId","opportunityId","assignee","bucket","durationMinutes","allDay","notes","meetingUrl","guests"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.task_done":{"post":{"operationId":"crm.task_done","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.task_done.md"},"x-mcp-tool":"crm_task_done","x-cli":"node cli/atomiks.mjs crm.task_done --json '{...}'","x-session-only":false,"summary":"Concluir ou reabrir tarefa","description":"`done: true` conclui; `false` reabre. `outcome` (só ao concluir) é o resultado da próxima ação, como no original: `true` = deu certo, `false` = não deu certo, omitido ou `null` = sem resultado. Se a tarefa é a próxima ação de uma cadência de follow-up, o resultado decide o passo seguinte (deu certo pula de fase; os outros seguem o próximo passo).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"done":{"type":"boolean"},"outcome":{"type":["boolean","null"]}},"required":["id","done"]},"example":{"id":"00000000-0000-0000-0000-000000000000","done":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"doneAt":{"type":["string","null"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"conversationId":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]},"durationMinutes":{"type":["number","null"]},"allDay":{"type":"boolean"},"notes":{"type":["string","null"]},"meetingUrl":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}}},"required":["id","title","kind","dueAt","done","doneAt","contact","conversationId","opportunityId","assignee","bucket","durationMinutes","allDay","notes","meetingUrl","guests"],"additionalProperties":false}},"required":["task"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.task_delete":{"post":{"operationId":"crm.task_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.task_delete.md"},"x-mcp-tool":"crm_task_delete","x-cli":"node cli/atomiks.mjs crm.task_delete --json '{...}'","x-session-only":false,"summary":"Apagar tarefa","description":"Remove a tarefa de vez.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.conversation_start":{"post":{"operationId":"inbox.conversation_start","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.conversation_start.md"},"x-mcp-tool":"inbox_conversation_start","x-cli":"node cli/atomiks.mjs inbox.conversation_start --json '{...}'","x-session-only":false,"summary":"Iniciar conversa com um contato","description":"Devolve a conversa do contato no número escolhido ou cria uma nova (aberta, sem atendente, no WhatsApp oficial a janela de 24 h começa fechada e a primeira mensagem tem de ser um modelo; no número por QR qualquer mensagem). O contato vem de `contactId` ou de `phone` (dígitos com DDI, 10 a 15; `+`, espaços e traços são ignorados): com `phone` o contato é achado pelo telefone ou criado agora (`name` só preenche nome vazio); no número por QR o telefone é conferido no WhatsApp (sem WhatsApp: `invalid_input`) e vale o telefone canônico dele. Exige acesso ao número e que ele esteja conectado.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"phone":{"type":"string","maxLength":40},"name":{"type":"string","maxLength":120},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string"}},"required":["conversationId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.start_candidates":{"post":{"operationId":"inbox.start_candidates","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.start_candidates.md"},"x-mcp-tool":"inbox_start_candidates","x-cli":"node cli/atomiks.mjs inbox.start_candidates --json '{...}'","x-session-only":false,"summary":"Contatos e números para iniciar conversa","description":"Até 50 contatos com telefone que o membro pode ver (busca por nome ou telefone a partir de 2 caracteres; contatos ainda sem conversa entram) e os números conectados que ele pode usar.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80}}},"example":{"q":"Maria"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":"string"}},"required":["id","name","phone"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false}}},"required":["contacts","channels"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.dashboard":{"post":{"operationId":"inbox.dashboard","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.dashboard.md"},"x-mcp-tool":"inbox_dashboard","x-cli":"node cli/atomiks.mjs inbox.dashboard --json '{...}'","x-session-only":false,"summary":"Painel do atendimento","description":"Números do atendimento só das conversas que o membro enxerga: `mine` (atribuídas a mim, abertas), `queue` (abertas sem atendente), `resolvedInPeriod` (resolvidas entre `from` e `to`), `byStatus` (todas, por status) e `avgFirstResponseSeconds` (média, nos atendimentos iniciados no período, entre a primeira mensagem do contato e a primeira resposta de uma pessoa; null sem dados). Com `viewAsAttendantId` (só admin) `mine`, `resolvedInPeriod` (resolvidos por ele) e `avgFirstResponseSeconds` (atendimentos atribuídos a ele no período) são os do atendente indicado; `queue` e `byStatus` continuam os das conversas que o admin enxerga. Gráficos e atividade: `inbox.dashboard_metrics`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"viewAsAttendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["from","to"]},"example":{"from":"2026-10-01T00:00:00-03:00","to":"2026-10-31T23:59:59-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mine":{"type":"number"},"queue":{"type":"number"},"resolvedInPeriod":{"type":"number"},"avgFirstResponseSeconds":{"type":["number","null"]},"byStatus":{"type":"object","properties":{"open":{"type":"number"},"assigned":{"type":"number"},"resolved":{"type":"number"},"closed":{"type":"number"}},"required":["open","assigned","resolved","closed"],"additionalProperties":false}},"required":["mine","queue","resolvedInPeriod","avgFirstResponseSeconds","byStatus"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.block":{"post":{"operationId":"inbox.block","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.block.md"},"x-mcp-tool":"inbox_block","x-cli":"node cli/atomiks.mjs inbox.block --json '{...}'","x-session-only":false,"summary":"Bloquear ou desbloquear o contato de uma conversa","description":"Bloqueia (`block: true`) ou desbloqueia o contato no WhatsApp do número por QR code e marca a conversa (`blockedAt`). Bloqueado no celular também aparece como bloqueado. Só conversa individual de número por QR; se o número ainda não permite, devolve erro claro. Antes da migration `20261030000020` devolve `migration_pendente`.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"block":{"type":"boolean"}},"required":["conversationId","block"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","block":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true},"blockedAt":{"type":["string","null"]}},"required":["ok","blockedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.vcard_preview":{"post":{"operationId":"inbox.vcard_preview","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.vcard_preview.md"},"x-mcp-tool":"inbox_vcard_preview","x-cli":"node cli/atomiks.mjs inbox.vcard_preview --json '{...}'","x-session-only":false,"summary":"Ver o cartão de contato: foto e se tem WhatsApp","description":"Para cada contato do cartão (`type: contacts`): nome, telefone, se o telefone tem WhatsApp (`hasWhatsapp`, null se não deu para saber), foto (`pictureUrl`) e o `contactId` do Atomiks quando já existe. A consulta ao WhatsApp fica guardada no `meta` da mensagem por 24 h. Em número que não é por QR code só devolve nome e telefone.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["messageId"]},"example":{"messageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"phones":{"type":"array","items":{"type":"string"}},"hasWhatsapp":{"type":["boolean","null"]},"pictureUrl":{"type":["string","null"]},"contactId":{"type":["string","null"]}},"required":["name","phone","phones","hasWhatsapp","pictureUrl","contactId"],"additionalProperties":false}}},"required":["contacts"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capi.settings_get":{"post":{"operationId":"capi.settings_get","tags":["capi"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/capi.settings_get.md"},"x-mcp-tool":"capi_settings_get","x-cli":"node cli/atomiks.mjs capi.settings_get --json '{...}'","x-session-only":false,"summary":"Ver configuração das conversões","description":"Configuração da API de Conversões da Meta da conta: ligada, enviar `Purchase` a cada venda, enviar `LeadSubmitted` no primeiro clique de anúncio, página (só dígitos, usada quando não há clique de anúncio) e código de teste do Gerenciador de Eventos. Sem registro, devolve os padrões (desligada).","x-scope":"conversions:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"purchaseOnSale":{"type":"boolean"},"leadOnCtwa":{"type":"boolean"},"pageId":{"type":["string","null"]},"testEventCode":{"type":["string","null"]}},"required":["enabled","purchaseOnSale","leadOnCtwa","pageId","testEventCode"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capi.settings_update":{"post":{"operationId":"capi.settings_update","tags":["capi"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/capi.settings_update.md"},"x-mcp-tool":"capi_settings_update","x-cli":"node cli/atomiks.mjs capi.settings_update --json '{...}'","x-session-only":false,"summary":"Alterar configuração das conversões","description":"Altera a configuração das conversões. Campos omitidos não mudam; `pageId` e `testEventCode` aceitam `null` para limpar.","x-scope":"conversions:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"purchaseOnSale":{"type":"boolean"},"leadOnCtwa":{"type":"boolean"},"pageId":{"anyOf":[{"type":"string","pattern":"^[0-9]+$"},{"type":"null"}]},"testEventCode":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}}},"example":{"enabled":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"purchaseOnSale":{"type":"boolean"},"leadOnCtwa":{"type":"boolean"},"pageId":{"type":["string","null"]},"testEventCode":{"type":["string","null"]}},"required":["enabled","purchaseOnSale","leadOnCtwa","pageId","testEventCode"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capi.stage_event_set":{"post":{"operationId":"capi.stage_event_set","tags":["capi"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/capi.stage_event_set.md"},"x-mcp-tool":"capi_stage_event_set","x-cli":"node cli/atomiks.mjs capi.stage_event_set --json '{...}'","x-session-only":false,"summary":"Definir o evento da Meta de uma etapa","description":"Define (ou, com `null`, remove) o evento da API de Conversões enviado quando um card entra na etapa. Só etapas abertas; Ganho já manda `Purchase` pela venda. Eventos: LeadSubmitted, InitiateCheckout, AddToCart, ViewContent, OrderCreated, OrderShipped, OrderDelivered, OrderCanceled, OrderReturned, CartAbandoned, QualifiedLead, RatingProvided, ReviewProvided.","x-scope":"conversions:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eventName":{"type":["string","null"]}},"required":["stageId","eventName"]},"example":{"stageId":"00000000-0000-0000-0000-000000000000","eventName":"QualifiedLead"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string"},"eventName":{"type":["string","null"]}},"required":["stageId","eventName"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capi.deliveries_list":{"post":{"operationId":"capi.deliveries_list","tags":["capi"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/capi.deliveries_list.md"},"x-mcp-tool":"capi_deliveries_list","x-cli":"node cli/atomiks.mjs capi.deliveries_list --json '{...}'","x-session-only":false,"summary":"Listar entregas de conversões","description":"Entregas da fila da API de Conversões, da mais recente para a mais antiga, 50 por página. Filtro opcional por `status`. `cursor` é o `nextCursor` da página anterior.","x-scope":"conversions:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"cursor":{"type":"string","pattern":"^\\d+$"}}},"example":{"status":"failed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"status":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"valueCents":{"type":["number","null"]},"attempts":{"type":"number"},"lastError":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","eventName","status","contact","valueCents","attempts","lastError","sentAt","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/capi.delivery_retry":{"post":{"operationId":"capi.delivery_retry","tags":["capi"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/capi.delivery_retry.md"},"x-mcp-tool":"capi_delivery_retry","x-cli":"node cli/atomiks.mjs capi.delivery_retry --json '{...}'","x-session-only":false,"summary":"Reenviar uma entrega de conversão","description":"Recoloca na fila uma entrega `failed` ou `skipped`, zerando as tentativas. Outros estados são recusados.","x-scope":"conversions:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"status":{"type":"string","enum":["pending","sending","sent","failed","skipped"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},"valueCents":{"type":["number","null"]},"attempts":{"type":"number"},"lastError":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","eventName","status","contact","valueCents","attempts","lastError","sentAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_connect":{"post":{"operationId":"channels.evolution_connect","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_connect.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Conectar um número por QR code","description":"Cria a sessão do número no servidor do WhatsApp por QR com o webhook do Atomiks, registra o canal `whatsapp_web` em `connecting` e devolve o QR code para escanear no celular. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]},"example":{"name":"Atendimento"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"qr":{"type":"object","properties":{"base64":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["base64","code"],"additionalProperties":false}},"required":["channelId","qr"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_qr":{"post":{"operationId":"channels.evolution_qr","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_qr.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Estado e QR code de um número por QR","description":"Consulta o estado da sessão do número (reinicia a que caiu). Se ainda não estiver conectada, devolve um QR code novo; ao conectar, o canal fica `ready`. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["connecting","ready","disconnected"]},"qr":{"anyOf":[{"type":"object","properties":{"base64":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["base64","code"],"additionalProperties":false},{"type":"null"}]}},"required":["status","qr"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_cancel":{"post":{"operationId":"channels.evolution_cancel","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_cancel.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Cancelar a conexão por QR code","description":"Apaga a sessão do número no servidor e o canal que ainda não terminou de conectar. Canal já conectado se desconecta por `channels.disconnect`. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_settings_update":{"post":{"operationId":"channels.evolution_settings_update","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_settings_update.md"},"x-mcp-tool":"channels_evolution_settings_update","x-cli":"node cli/atomiks.mjs channels.evolution_settings_update --json '{...}'","x-session-only":false,"summary":"Ajustes de um número por QR: grupos e presença online","description":"Só número por QR; manda um ou mais campos. Ajustes sem coluna própria: `rejectCall` (recusa ligações), `msgCall` (texto enviado a quem ligou), `readMessages` (marca como lida ao receber) e `readStatus` (vê os status dos contatos). `receiveGroups`: desligado, as mensagens de grupo não entram no atendimento. `alwaysOnline`: aplica a presença na hora. Ligado, o número aparece online para os contatos, mas o WhatsApp para de mandar notificação ao celular e aos outros aparelhos. Desligado (padrão), o Atomiks reafirma a presença offline a cada 5 minutos e as notificações continuam.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"rejectCall":{"type":"boolean"},"msgCall":{"type":"string","maxLength":300},"readMessages":{"type":"boolean"},"readStatus":{"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","receiveGroups":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"}},"required":["channelId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_profile_get":{"post":{"operationId":"channels.evolution_profile_get","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_profile_get.md"},"x-mcp-tool":"channels_evolution_profile_get","x-cli":"node cli/atomiks.mjs channels.evolution_profile_get --json '{...}'","x-session-only":false,"summary":"Foto, nome e recado do WhatsApp de um número por QR","description":"Lê do servidor do número o perfil do próprio número: nome do perfil, recado (\"Sobre\"), URL da foto (expira; a tela renova ao abrir) e o telefone. Dado que o WhatsApp não devolver vem `null`.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":["string","null"]},"about":{"type":["string","null"]},"pictureUrl":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","about","pictureUrl","phone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_profile_update":{"post":{"operationId":"channels.evolution_profile_update","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_profile_update.md"},"x-mcp-tool":"channels_evolution_profile_update","x-cli":"node cli/atomiks.mjs channels.evolution_profile_update --json '{...}'","x-session-only":false,"summary":"Trocar nome, recado ou foto do WhatsApp de um número por QR","description":"Manda um ou mais: `name` (nome do perfil), `about` (recado, até 139 caracteres), `photo` (imagem JPEG/PNG de até 5 MB em base64) ou `removePhoto: true`. Grava direto no WhatsApp e devolve o perfil lido de novo. Só pela interface e API de administrador.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":25},"about":{"type":"string","maxLength":139},"photo":{"type":"object","properties":{"mimeType":{"type":"string","enum":["image/jpeg","image/png"]},"dataBase64":{"type":"string","minLength":1,"maxLength":7340032}},"required":["mimeType","dataBase64"]},"removePhoto":{"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","about":"Atendimento de segunda a sexta"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":["string","null"]},"about":{"type":["string","null"]},"pictureUrl":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","about","pictureUrl","phone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_settings_get":{"post":{"operationId":"channels.evolution_settings_get","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_settings_get.md"},"x-mcp-tool":"channels_evolution_settings_get","x-cli":"node cli/atomiks.mjs channels.evolution_settings_get --json '{...}'","x-session-only":false,"summary":"Ajustes de ligação e leitura de um número por QR","description":"Lê do número os ajustes que não têm coluna no Atomiks: `rejectCall`, `msgCall`, `readMessages` e `readStatus`. Grupos e \"sempre online\" já vêm na conta (`channel_connections.get`). Escreve-se com `channels.evolution_settings_update`.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rejectCall":{"type":"boolean"},"msgCall":{"type":"string"},"readMessages":{"type":"boolean"},"readStatus":{"type":"boolean"},"callsSupported":{"type":"boolean"}},"required":["rejectCall","msgCall","readMessages","readStatus","callsSupported"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_privacy_get":{"post":{"operationId":"channels.evolution_privacy_get","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_privacy_get.md"},"x-mcp-tool":"channels_evolution_privacy_get","x-cli":"node cli/atomiks.mjs channels.evolution_privacy_get --json '{...}'","x-session-only":false,"summary":"Privacidade do WhatsApp de um número por QR","description":"Lê do WhatsApp quem vê: confirmação de leitura (`readreceipts`: `all`/`none`), foto (`profile`), recado (`status`), online (`online`: `all`/`match_last_seen`), visto por último (`last`) e quem adiciona em grupos (`groupadd`). Valores: `all`, `contacts`, `contact_blacklist`, `none`, `match_last_seen`.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"readreceipts":{"type":["string","null"]},"profile":{"type":["string","null"]},"status":{"type":["string","null"]},"online":{"type":["string","null"]},"last":{"type":["string","null"]},"groupadd":{"type":["string","null"]}},"required":["readreceipts","profile","status","online","last","groupadd"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_privacy_update":{"post":{"operationId":"channels.evolution_privacy_update","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_privacy_update.md"},"x-mcp-tool":"channels_evolution_privacy_update","x-cli":"node cli/atomiks.mjs channels.evolution_privacy_update --json '{...}'","x-session-only":false,"summary":"Mudar a privacidade do WhatsApp de um número por QR","description":"Muda um ou mais campos de privacidade (mesmos nomes e valores de `channels.evolution_privacy_get`). O WhatsApp pede o conjunto todo: o Atomiks lê o atual, troca só o que veio e grava. Devolve o conjunto novo.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"readreceipts":{"type":"string","enum":["all","none"]},"profile":{"type":"string","enum":["all","contacts","contact_blacklist","none","match_last_seen"]},"status":{"type":"string","enum":["all","contacts","contact_blacklist","none","match_last_seen"]},"online":{"type":"string","enum":["all","match_last_seen"]},"last":{"type":"string","enum":["all","contacts","contact_blacklist","none","match_last_seen"]},"groupadd":{"type":"string","enum":["all","contacts","contact_blacklist","none","match_last_seen"]}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","last":"contacts"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"readreceipts":{"type":["string","null"]},"profile":{"type":["string","null"]},"status":{"type":["string","null"]},"online":{"type":["string","null"]},"last":{"type":["string","null"]},"groupadd":{"type":["string","null"]}},"required":["readreceipts","profile","status","online","last","groupadd"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.web_switch_provider":{"post":{"operationId":"channels.web_switch_provider","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.web_switch_provider.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Atualizar a conexão de um número por QR (ler o QR de novo)","description":"Leva um número por QR já conectado para o servidor de WhatsApp atual sem perder as conversas: cria a sessão nova e devolve o QR code para ler no mesmo celular. Ao ler com o mesmo número, a conexão antiga é apagada e o canal segue com o mesmo id e as mesmas conversas; com outro número, a sessão nova é descartada e `lastAttempt` vem `phone_mismatch` (nova sessão só com `restart: true`). Chamada de novo durante a troca devolve um QR novo; `cancel: true` desiste da troca. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"to":{"type":"string","enum":["evolution","waha"]},"cancel":{"type":"boolean"},"restart":{"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"qr":{"anyOf":[{"type":"object","properties":{"base64":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["base64","code"],"additionalProperties":false},{"type":"null"}]},"pairingCode":{"type":["string","null"]},"lastAttempt":{"anyOf":[{"type":"string","enum":["phone_mismatch"]},{"type":"null"}]}},"required":["qr","pairingCode","lastAttempt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.instagram_connect_url":{"post":{"operationId":"channels.instagram_connect_url","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.instagram_connect_url.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Endereço para conectar uma conta do Instagram","description":"Devolve o endereço que inicia o login do Instagram (conta profissional). O retorno grava o canal `instagram`. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.instagram_disconnect":{"post":{"operationId":"channels.instagram_disconnect","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.instagram_disconnect.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Desconectar uma conta do Instagram","description":"Cancela a inscrição do Atomiks nos eventos da conta, apaga o token e marca o canal como desconectado. As conversas continuam na conta. Só pela interface.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.instagram_settings":{"post":{"operationId":"channels.instagram_settings","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.instagram_settings.md"},"x-mcp-tool":"channels_instagram_settings","x-cli":"node cli/atomiks.mjs channels.instagram_settings --json '{...}'","x-session-only":false,"summary":"Ajustes de uma conta do Instagram","description":"Liga ou desliga o envio com Human Agent (resposta humana até 7 dias depois da última mensagem do contato). Só funciona depois que a Meta aprovar a permissão no app.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"humanAgent":{"type":"boolean"}},"required":["channelId","humanAgent"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","humanAgent":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"humanAgent":{"type":"boolean"}},"required":["id","humanAgent"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.list":{"post":{"operationId":"automations.list","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.list.md"},"x-mcp-tool":"automations_list","x-cli":"node cli/atomiks.mjs automations.list --json '{...}'","x-session-only":false,"summary":"Listar automações do Instagram","description":"Automações das contas do Instagram que o membro pode usar, com a quantidade de execuções nas últimas 24 horas. `channelId` filtra por conta.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"type":"array","items":{"type":"string"}},"dmText":{"type":["string","null"]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"runs24h":{"type":"number"}},"required":["id","channelId","name","enabled","trigger","mediaIds","keywords","matchMode","publicReplies","dmText","oncePerUser","reactHeart","delaySeconds","createdAt","updatedAt","runs24h"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.get":{"post":{"operationId":"automations.get","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.get.md"},"x-mcp-tool":"automations_get","x-cli":"node cli/atomiks.mjs automations.get --json '{...}'","x-session-only":false,"summary":"Ver automação do Instagram","description":"Uma automação pelo id.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"type":"array","items":{"type":"string"}},"dmText":{"type":["string","null"]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channelId","name","enabled","trigger","mediaIds","keywords","matchMode","publicReplies","dmText","oncePerUser","reactHeart","delaySeconds","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.create":{"post":{"operationId":"automations.create","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.create.md"},"x-mcp-tool":"automations_create","x-cli":"node cli/atomiks.mjs automations.create --json '{...}'","x-session-only":false,"summary":"Criar automação do Instagram","description":"Cria a automação. Gatilhos: `comment` (post ou reel), `live_comment`, `story_reply`, `dm_keyword`. `mediaIds` vazio = qualquer publicação; `keywords` vazio = qualquer texto. `publicReplies` (até 5, sorteia uma) só para `comment`. Precisa de resposta pública ou `dmText` (até 1000 caracteres). `{nome}` vira o @ de quem escreveu. `reactHeart` reage com ❤ à mensagem do contato (só `story_reply` e `dm_keyword`). `delaySeconds` (0 a 43200) espera esse tempo antes da mensagem no Direct; a resposta pública e a reação saem na hora; `live_comment` não aceita atraso.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"keywords":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"matchMode":{"default":"contains","type":"string","enum":["contains","exact"]},"publicReplies":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"dmText":{"default":null,"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"oncePerUser":{"default":true,"type":"boolean"},"reactHeart":{"default":false,"type":"boolean"},"delaySeconds":{"default":0,"type":"integer","minimum":0,"maximum":43200},"enabled":{"default":true,"type":"boolean"}},"required":["channelId","name","trigger"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","name":"Quero o guia","trigger":"comment","mediaIds":[],"keywords":["quero"],"matchMode":"contains","publicReplies":["Te mandei no Direct!"],"dmText":"Oi {nome}, aqui está o guia.","oncePerUser":true,"reactHeart":false,"delaySeconds":0,"enabled":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"type":"array","items":{"type":"string"}},"dmText":{"type":["string","null"]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channelId","name","enabled","trigger","mediaIds","keywords","matchMode","publicReplies","dmText","oncePerUser","reactHeart","delaySeconds","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.update":{"post":{"operationId":"automations.update","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.update.md"},"x-mcp-tool":"automations_update","x-cli":"node cli/atomiks.mjs automations.update --json '{...}'","x-session-only":false,"summary":"Alterar automação do Instagram","description":"Altera campos da automação. Campos omitidos não mudam; `dmText: null` limpa a mensagem. A conta do Instagram não muda.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"keywords":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"dmText":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"integer","minimum":0,"maximum":43200},"enabled":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","keywords":["quero","eu quero"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"type":"array","items":{"type":"string"}},"dmText":{"type":["string","null"]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channelId","name","enabled","trigger","mediaIds","keywords","matchMode","publicReplies","dmText","oncePerUser","reactHeart","delaySeconds","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.set_enabled":{"post":{"operationId":"automations.set_enabled","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.set_enabled.md"},"x-mcp-tool":"automations_set_enabled","x-cli":"node cli/atomiks.mjs automations.set_enabled --json '{...}'","x-session-only":false,"summary":"Ligar ou desligar automação do Instagram","description":"Liga ou desliga a automação. Execuções já na fila de uma automação desligada são puladas.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"type":"boolean"}},"required":["id","enabled"]},"example":{"id":"00000000-0000-0000-0000-000000000000","enabled":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["comment","live_comment","story_reply","dm_keyword"]},"mediaIds":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"matchMode":{"type":"string","enum":["contains","exact"]},"publicReplies":{"type":"array","items":{"type":"string"}},"dmText":{"type":["string","null"]},"oncePerUser":{"type":"boolean"},"reactHeart":{"type":"boolean"},"delaySeconds":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channelId","name","enabled","trigger","mediaIds","keywords","matchMode","publicReplies","dmText","oncePerUser","reactHeart","delaySeconds","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.delete":{"post":{"operationId":"automations.delete","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.delete.md"},"x-mcp-tool":"automations_delete","x-cli":"node cli/atomiks.mjs automations.delete --json '{...}'","x-session-only":false,"summary":"Apagar automação do Instagram","description":"Apaga a automação e o histórico de execuções dela.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.runs":{"post":{"operationId":"automations.runs","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.runs.md"},"x-mcp-tool":"automations_runs","x-cli":"node cli/atomiks.mjs automations.runs --json '{...}'","x-session-only":false,"summary":"Histórico de execuções das automações","description":"Execuções do mais recente para o mais antigo. Filtros: `automationId`, `status`. Use `before` (o `nextBefore` anterior) para a página seguinte.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"automationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","sending","done","failed","skipped"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"before":{"type":"string"}}},"example":{"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"automationName":{"type":["string","null"]},"status":{"type":"string","enum":["pending","sending","done","failed","skipped"]},"igUserId":{"type":"string"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"commentId":{"type":["string","null"]},"mediaId":{"type":["string","null"]},"attempts":{"type":"number"},"lastError":{"type":["string","null"]},"publicReplyId":{"type":["string","null"]},"dmMessageId":{"type":["string","null"]},"createdAt":{"type":"string"},"doneAt":{"type":["string","null"]}},"required":["id","automationId","automationName","status","igUserId","contact","commentId","mediaId","attempts","lastError","publicReplyId","dmMessageId","createdAt","doneAt"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.media":{"post":{"operationId":"automations.media","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.media.md"},"x-mcp-tool":"automations_media","x-cli":"node cli/atomiks.mjs automations.media --json '{...}'","x-session-only":false,"summary":"Listar publicações ou stories da conta","description":"Publicações (posts e reels) ou stories da conta do Instagram, para escolher onde a automação vale. Campo ausente na Meta volta `null`.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["posts","stories"]}},"required":["channelId","kind"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","kind":"posts"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"caption":{"type":["string","null"]},"mediaType":{"type":["string","null"]},"productType":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"timestamp":{"type":["string","null"]}},"required":["id","caption","mediaType","productType","permalink","thumbnailUrl","timestamp"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/automations.test":{"post":{"operationId":"automations.test","tags":["automations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/automations.test.md"},"x-mcp-tool":"automations_test","x-cli":"node cli/atomiks.mjs automations.test --json '{...}'","x-session-only":false,"summary":"Testar o texto de uma automação","description":"Diz se um texto (e uma publicação, se a automação limita) dispararia a automação. Não envia nada.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"automationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","maxLength":2200},"mediaId":{"type":"string"}},"required":["automationId","text"]},"example":{"automationId":"00000000-0000-0000-0000-000000000000","text":"Eu quero!"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"matches":{"type":"boolean"}},"required":["matches"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.profile_get":{"post":{"operationId":"contacts.profile_get","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.profile_get.md"},"x-mcp-tool":"contacts_profile_get","x-cli":"node cli/atomiks.mjs contacts.profile_get --json '{...}'","x-session-only":false,"summary":"Perfil completo do contato","description":"Dados do contato (nome, telefone, e-mail, Instagram sem @, Telegram, aniversário AAAA-MM-DD, endereço, documento), permissão de envio por canal (`consents`, os 6 canais; `recorded: false` = sem decisão, vale \"pode receber\"), tags, listas e campos personalizados ativos da conta com o valor do contato (`value: null` quando vazio).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"instagram":{"type":["string","null"]},"telegram":{"type":["string","null"]},"birthday":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"cep":{"type":"string"},"rua":{"type":"string"},"numero":{"type":"string"},"complemento":{"type":"string"},"bairro":{"type":"string"},"cidade":{"type":"string"},"estado":{"type":"string"},"pais":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"document":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"consents":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","email","sms","instagram","telegram","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"recorded":{"type":"boolean"},"changedAt":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["manual","inbound","import","api"]},{"type":"null"}]}},"required":["channel","status","recorded","changedAt","source"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["id","key","label","type","fieldType","options","position","archived","value"],"additionalProperties":false}}},"required":["id","name","phone","email","instagram","telegram","birthday","address","document","firstSeenAt","consents","tags","lists","customFields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.profile_update":{"post":{"operationId":"contacts.profile_update","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.profile_update.md"},"x-mcp-tool":"contacts_profile_update","x-cli":"node cli/atomiks.mjs contacts.profile_update --json '{...}'","x-session-only":false,"summary":"Editar dados do contato","description":"Altera nome, e-mail, Instagram (aceita @), Telegram, aniversário (AAAA-MM-DD), endereço (cep, rua, numero, complemento, bairro, cidade, estado, pais) e documento. Todos aceitam `null` (ou texto vazio) para limpar; o endereço é substituído por inteiro. O telefone não se edita aqui: é a identidade do WhatsApp do contato.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"email":{"anyOf":[{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},{"type":"string","const":""}]},"instagram":{"anyOf":[{"anyOf":[{"type":"string","pattern":"^@?[A-Za-z0-9._]{1,30}$"},{"type":"null"}]},{"type":"string","const":""}]},"telegram":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"document":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"anyOf":[{"type":"object","properties":{"cep":{"type":"string"},"rua":{"type":"string"},"numero":{"type":"string"},"complemento":{"type":"string"},"bairro":{"type":"string"},"cidade":{"type":"string"},"estado":{"type":"string"},"pais":{"type":"string"}},"additionalProperties":false},{"type":"null"}]}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","email":"maria@exemplo.com"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"instagram":{"type":["string","null"]},"telegram":{"type":["string","null"]},"birthday":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"cep":{"type":"string"},"rua":{"type":"string"},"numero":{"type":"string"},"complemento":{"type":"string"},"bairro":{"type":"string"},"cidade":{"type":"string"},"estado":{"type":"string"},"pais":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"document":{"type":["string","null"]},"firstSeenAt":{"type":"string"},"consents":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","email","sms","instagram","telegram","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"recorded":{"type":"boolean"},"changedAt":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["manual","inbound","import","api"]},{"type":"null"}]}},"required":["channel","status","recorded","changedAt","source"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["id","key","label","type","fieldType","options","position","archived","value"],"additionalProperties":false}}},"required":["id","name","phone","email","instagram","telegram","birthday","address","document","firstSeenAt","consents","tags","lists","customFields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.consents_list":{"post":{"operationId":"contacts.consents_list","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.consents_list.md"},"x-mcp-tool":"contacts_consents_list","x-cli":"node cli/atomiks.mjs contacts.consents_list --json '{...}'","x-session-only":false,"summary":"Permissão de envio por canal","description":"Os 6 canais (whatsapp, email, sms, instagram, telegram, voice) com `status` opted_in/opted_out, `recorded` (houve decisão), `changedAt` e `source`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","email","sms","instagram","telegram","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"recorded":{"type":"boolean"},"changedAt":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["manual","inbound","import","api"]},{"type":"null"}]}},"required":["channel","status","recorded","changedAt","source"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.consent_set":{"post":{"operationId":"contacts.consent_set","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.consent_set.md"},"x-mcp-tool":"contacts_consent_set","x-cli":"node cli/atomiks.mjs contacts.consent_set --json '{...}'","x-session-only":false,"summary":"Definir permissão de envio de um canal","description":"`status: opted_out` = \"Não quer receber\"; `opted_in` = \"Pode receber\". Registra quem mudou e quando. Devolve a lista completa de canais.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channel":{"type":"string","enum":["whatsapp","email","sms","instagram","telegram","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]}},"required":["contactId","channel","status"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","channel":"whatsapp","status":"opted_out"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","email","sms","instagram","telegram","voice"]},"status":{"type":"string","enum":["opted_in","opted_out"]},"recorded":{"type":"boolean"},"changedAt":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["manual","inbound","import","api"]},{"type":"null"}]}},"required":["channel","status","recorded","changedAt","source"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.fields_list":{"post":{"operationId":"crm.fields_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.fields_list.md"},"x-mcp-tool":"crm_fields_list","x-cli":"node cli/atomiks.mjs crm.fields_list --json '{...}'","x-session-only":false,"summary":"Listar campos personalizados da conta","description":"Definições dos campos personalizados, em ordem. `includeArchived: true` traz também os arquivados. `type` é o armazenamento (text, number, date, select com `options`, boolean, file) e `fieldType` o tipo da tela (também textarea, currency, percentage, multi_select, radio, link, rating, image).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"includeArchived":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","key","label","type","fieldType","options","position","archived"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.field_create":{"post":{"operationId":"crm.field_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.field_create.md"},"x-mcp-tool":"crm_field_create","x-cli":"node cli/atomiks.mjs crm.field_create --json '{...}'","x-session-only":false,"summary":"Criar campo personalizado","description":"Cria a definição. `key` (a-z, 0-9, _) sai do rótulo se omitida e é única na conta. `options` é obrigatório (e só vale) para `select`. O tipo não muda depois.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"options":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["label","type"]},"example":{"label":"Cidade","type":"text"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","key","label","type","fieldType","options","position","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.field_update":{"post":{"operationId":"crm.field_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.field_update.md"},"x-mcp-tool":"crm_field_update","x-cli":"node cli/atomiks.mjs crm.field_update --json '{...}'","x-session-only":false,"summary":"Editar campo personalizado","description":"Muda rótulo, opções (só `select`; valores já gravados que saírem das opções continuam guardados) e posição. `archived: true` arquiva (some do perfil, valores ficam); `false` restaura.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":80},"options":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"position":{"type":"integer","minimum":0,"maximum":1000},"archived":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","label":"Cidade natal"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","key","label","type","fieldType","options","position","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.field_delete":{"post":{"operationId":"crm.field_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.field_delete.md"},"x-mcp-tool":"crm_field_delete","x-cli":"node cli/atomiks.mjs crm.field_delete --json '{...}'","x-session-only":false,"summary":"Apagar campo personalizado","description":"Apaga a definição e os valores de todos os contatos, de vez. Para só esconder, use `crm.field_update` com `archived: true`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.field_values_set":{"post":{"operationId":"contacts.field_values_set","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.field_values_set.md"},"x-mcp-tool":"contacts_field_values_set","x-cli":"node cli/atomiks.mjs contacts.field_values_set --json '{...}'","x-session-only":false,"summary":"Gravar valores de campos personalizados do contato","description":"Lista de `{fieldId, value}`; `value: null` limpa. Pelo `fieldType`: text (1-500), textarea (até 10000), number, currency, percentage, rating (1 a 5), date (AAAA-MM-DD), select e radio (uma das opções), multi_select (lista de opções), link (http/https), boolean, file e image (id do upload). Tudo ou nada: um valor inválido recusa o pedido. Devolve os campos ativos com os valores.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"values":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["fieldId","value"]}}},"required":["contactId","values"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","values":[{"fieldId":"00000000-0000-0000-0000-000000000000","value":"São Paulo"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","select","boolean","file"]},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"position":{"type":"number"},"archived":{"type":"boolean"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["id","key","label","type","fieldType","options","position","archived","value"],"additionalProperties":false}}},"required":["customFields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tags_list":{"post":{"operationId":"crm.tags_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tags_list.md"},"x-mcp-tool":"crm_tags_list","x-cli":"node cli/atomiks.mjs crm.tags_list --json '{...}'","x-session-only":false,"summary":"Listar tags da conta","description":"Tags da conta em ordem alfabética, com quantos contatos usam cada uma. `q` filtra pelo nome.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":40}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"contacts":{"type":"number"}},"required":["id","name","color","contacts"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tag_create":{"post":{"operationId":"crm.tag_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tag_create.md"},"x-mcp-tool":"crm_tag_create","x-cli":"node cli/atomiks.mjs crm.tag_create --json '{...}'","x-session-only":false,"summary":"Criar tag","description":"Qualquer membro cria pelo painel (\"Buscar ou criar tag\"). Nome único na conta sem diferenciar maiúsculas; `color` é a chave de um token do design system (padrão `gray`). Se a tag já existe, devolve a existente.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,23}$"}},"required":["name"]},"example":{"name":"VIP"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tag_update":{"post":{"operationId":"crm.tag_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tag_update.md"},"x-mcp-tool":"crm_tag_update","x-cli":"node cli/atomiks.mjs crm.tag_update --json '{...}'","x-session-only":false,"summary":"Editar tag","description":"Renomeia ou muda a cor.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,23}$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Cliente VIP"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tag_delete":{"post":{"operationId":"crm.tag_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tag_delete.md"},"x-mcp-tool":"crm_tag_delete","x-cli":"node cli/atomiks.mjs crm.tag_delete --json '{...}'","x-session-only":false,"summary":"Apagar tag","description":"Apaga a tag e a tira de todos os contatos.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tag_attach":{"post":{"operationId":"crm.tag_attach","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tag_attach.md"},"x-mcp-tool":"crm_tag_attach","x-cli":"node cli/atomiks.mjs crm.tag_attach --json '{...}'","x-session-only":false,"summary":"Aplicar tag ao contato","description":"Idempotente. Devolve as tags do contato.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"tagId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId","tagId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","tagId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}},"required":["tags"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.tag_detach":{"post":{"operationId":"crm.tag_detach","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.tag_detach.md"},"x-mcp-tool":"crm_tag_detach","x-cli":"node cli/atomiks.mjs crm.tag_detach --json '{...}'","x-session-only":false,"summary":"Tirar tag do contato","description":"Idempotente. Devolve as tags do contato.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"tagId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId","tagId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","tagId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}},"required":["tags"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.lists_list":{"post":{"operationId":"crm.lists_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.lists_list.md"},"x-mcp-tool":"crm_lists_list","x-cli":"node cli/atomiks.mjs crm.lists_list --json '{...}'","x-session-only":false,"summary":"Listar listas de contatos da conta","description":"Listas manuais da conta em ordem alfabética, com o total de contatos. `q` filtra pelo nome.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"contacts":{"type":"number"}},"required":["id","name","contacts"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.list_create":{"post":{"operationId":"crm.list_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.list_create.md"},"x-mcp-tool":"crm_list_create","x-cli":"node cli/atomiks.mjs crm.list_create --json '{...}'","x-session-only":false,"summary":"Criar lista de contatos","description":"Lista manual. Nome único na conta sem diferenciar maiúsculas; se já existe, devolve a existente.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]},"example":{"name":"Clientes de outubro"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.list_rename":{"post":{"operationId":"crm.list_rename","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.list_rename.md"},"x-mcp-tool":"crm_list_rename","x-cli":"node cli/atomiks.mjs crm.list_rename --json '{...}'","x-session-only":false,"summary":"Renomear lista","description":"Muda o nome da lista.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["id","name"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Clientes VIP"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.list_delete":{"post":{"operationId":"crm.list_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.list_delete.md"},"x-mcp-tool":"crm_list_delete","x-cli":"node cli/atomiks.mjs crm.list_delete --json '{...}'","x-session-only":false,"summary":"Apagar lista","description":"Apaga a lista e tira todos os contatos dela. Os contatos continuam existindo.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.list_add":{"post":{"operationId":"crm.list_add","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.list_add.md"},"x-mcp-tool":"crm_list_add","x-cli":"node cli/atomiks.mjs crm.list_add --json '{...}'","x-session-only":false,"summary":"Adicionar contato a uma lista","description":"Idempotente. Devolve as listas do contato.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId","listId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","listId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["lists"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.list_remove":{"post":{"operationId":"crm.list_remove","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.list_remove.md"},"x-mcp-tool":"crm_list_remove","x-cli":"node cli/atomiks.mjs crm.list_remove --json '{...}'","x-session-only":false,"summary":"Tirar contato de uma lista","description":"Idempotente. Devolve as listas do contato.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId","listId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","listId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["lists"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.history":{"post":{"operationId":"contacts.history","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.history.md"},"x-mcp-tool":"contacts_history","x-cli":"node cli/atomiks.mjs contacts.history --json '{...}'","x-session-only":false,"summary":"Histórico do contato","description":"Linha do tempo do contato (mais recente primeiro) e atividade por semana. `filter`: all, conversation (mensagens, notas internas, eventos de atendimento), purchases (compras), automations (execuções de automação); `all` inclui também oportunidades e tarefas. `weekly` cobre as últimas 12 semanas (janelas de 7 dias terminando hoje, no fuso da conta, da mais antiga à atual) com `total`, `thisWeek` e `peak` (`weeksAgo` 0 = esta semana; null sem atividade), e não muda com nenhum filtro. Itens: até 300 mais recentes por fonte; cada um traz `eventName` (veja `contacts.history_filter_options`). Paginação: `before` = `nextBefore` da resposta anterior. Filtros novos (aba Histórico de Atividades): `q` (texto no título e no detalhe, sem acento nem caixa), `eventNames`, `from`/`to` (ISO com fuso, inclusivos), `tagIds`, `flowIds`, `pipelineIds` (E entre filtros, qualquer valor dentro da lista). Qualquer filtro novo presente, até `eventNames: []`, liga o modo ampliado: entram também execuções de flow (`type: flow`) e eventos de domínio (`type: event`, como etiqueta adicionada ou oportunidade mudou de etapa). Sem eles a resposta é a de sempre.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filter":{"type":"string","enum":["all","conversation","purchases","automations"]},"limit":{"type":"integer","minimum":1,"maximum":100},"before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"q":{"type":"string","minLength":1,"maxLength":200},"eventNames":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"flowIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"pipelineIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","filter":"all"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"weekly":{"type":"object","properties":{"weeks":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"count":{"type":"number"}},"required":["start","count"],"additionalProperties":false}},"total":{"type":"number"},"thisWeek":{"type":"number"},"peak":{"anyOf":[{"type":"object","properties":{"count":{"type":"number"},"weeksAgo":{"type":"number"}},"required":["count","weeksAgo"],"additionalProperties":false},{"type":"null"}]}},"required":["weeks","total","thisWeek","peak"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message","attendance","note","sale","opportunity","task","automation","event","flow"]},"eventName":{"type":"string"},"category":{"type":"string","enum":["conversation","purchases","automations","other"]},"at":{"type":"string"},"title":{"type":"string"},"detail":{"type":["string","null"]},"channelKind":{"anyOf":[{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},{"type":"null"}]},"valueCents":{"type":["number","null"]}},"required":["id","type","eventName","category","at","title","detail","channelKind","valueCents"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["weekly","items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.history_filter_options":{"post":{"operationId":"contacts.history_filter_options","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.history_filter_options.md"},"x-mcp-tool":"contacts_history_filter_options","x-cli":"node cli/atomiks.mjs contacts.history_filter_options --json '{...}'","x-session-only":false,"summary":"Opções dos filtros do histórico","description":"O que os filtros de `contacts.history` aceitam: `events` (tipos de evento com rótulo e grupo; `name` vai em `eventNames`) e as etiquetas, flows (sem os arquivados) e pipelines (sem os arquivados) da conta, por nome.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"}},"required":["name","label","group"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"flows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["events","tags","flows","pipelines"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.availability_get":{"post":{"operationId":"crm.availability_get","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.availability_get.md"},"x-mcp-tool":"crm_availability_get","x-cli":"node cli/atomiks.mjs crm.availability_get --json '{...}'","x-session-only":false,"summary":"Disponibilidade de um atendente","description":"Expediente semanal usado em \"Horários livres\": `weekly` = {mon..sun: [[\"09:00\",\"12:00\"], ...]} no `timezone` do atendente, `slotMinutes` é o passo da grade. `configured: false` = ainda sem disponibilidade (\"Configurar disponibilidade\"). `userId` omitido ou \"me\" = o chamador.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"me"}]}}},"example":{"userId":"me"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"configured":{"type":"boolean"},"timezone":{"type":"string"},"slotMinutes":{"type":"number"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false}},"required":["userId","configured","timezone","slotMinutes","weekly"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.availability_update":{"post":{"operationId":"crm.availability_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.availability_update.md"},"x-mcp-tool":"crm_availability_update","x-cli":"node cli/atomiks.mjs crm.availability_update --json '{...}'","x-session-only":false,"summary":"Definir disponibilidade de um atendente","description":"Cada um edita a própria; o admin edita a de qualquer atendente. `weekly` substitui por inteiro (faixas HH:MM, início antes do fim, sem sobreposição, até 8 por dia). `slotMinutes` em 5, 10, 15, 20, 30, 45 ou 60. `timezone` é um fuso IANA.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"me"}]},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"slotMinutes":{"type":"number"},"timezone":{"type":"string","maxLength":64}},"required":["weekly"]},"example":{"weekly":{"mon":[["09:00","12:00"],["14:00","18:00"]]}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"configured":{"type":"boolean"},"timezone":{"type":"string"},"slotMinutes":{"type":"number"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false}},"required":["userId","configured","timezone","slotMinutes","weekly"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.agenda_get":{"post":{"operationId":"crm.agenda_get","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.agenda_get.md"},"x-mcp-tool":"crm_agenda_get","x-cli":"node cli/atomiks.mjs crm.agenda_get --json '{...}'","x-session-only":false,"summary":"Agenda de um responsável (blocos ocupados)","description":"Tarefas e reuniões do responsável com horário entre `from` e `to` (até 14 dias), para desenhar a linha do dia e achar conflitos. Conta tudo da conta, inclusive de contatos que o chamador não vê: nesses, `title` e `contactId` vêm `null` (só o bloco ocupado). Sem `durationMinutes` o bloco conta 30 min; `allDay` ocupa o dia. Traz também a disponibilidade.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"me"}]},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["from","to"]},"example":{"assigneeId":"me","from":"2026-10-24T00:00:00-03:00","to":"2026-10-25T00:00:00-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"availability":{"type":"object","properties":{"userId":{"type":"string"},"configured":{"type":"boolean"},"timezone":{"type":"string"},"slotMinutes":{"type":"number"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false}},"required":["userId","configured","timezone","slotMinutes","weekly"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"taskId":{"type":"string"},"dueAt":{"type":"string"},"durationMinutes":{"type":"number"},"allDay":{"type":"boolean"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"done":{"type":"boolean"},"title":{"type":["string","null"]},"contactId":{"type":["string","null"]}},"required":["taskId","dueAt","durationMinutes","allDay","kind","done","title","contactId"],"additionalProperties":false}}},"required":["availability","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.companies_list":{"post":{"operationId":"crm.companies_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.companies_list.md"},"x-mcp-tool":"crm_companies_list","x-cli":"node cli/atomiks.mjs crm.companies_list --json '{...}'","x-session-only":false,"summary":"Listar empresas da conta","description":"Empresas para vincular a oportunidades, em ordem alfabética. `q` filtra pelo nome. Até 200.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":120}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.company_create":{"post":{"operationId":"crm.company_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.company_create.md"},"x-mcp-tool":"crm_company_create","x-cli":"node cli/atomiks.mjs crm.company_create --json '{...}'","x-session-only":false,"summary":"Criar empresa","description":"Nome único na conta sem diferenciar maiúsculas; se já existe, devolve a existente.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"]},"example":{"name":"Acme Ltda"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.dashboard_metrics":{"post":{"operationId":"inbox.dashboard_metrics","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.dashboard_metrics.md"},"x-mcp-tool":"inbox_dashboard_metrics","x-cli":"node cli/atomiks.mjs inbox.dashboard_metrics --json '{...}'","x-session-only":false,"summary":"Gráficos e atividade do painel do atendimento","description":"Métricas do período `from`..`to` (até 92 dias) das conversas que o membro enxerga: `volume` (atendimentos iniciados por hora, se o período tem até 36 h, senão por dia, no fuso da conta, com buckets vazios preenchidos), `byChannel` (por tipo de canal), `avgFirstResponseSeconds`, `avgResolutionSeconds` (atendimentos resolvidos), `responseBuckets` (primeira resposta média por hora ou por dia da semana, 0 = domingo), `recentActivity` (6 eventos: atribuída, transferida, resolvida, reaberta; sem repetir conversa+evento) e `byAttendant` (admin: todos; membro: só ele). Com `viewAsAttendantId` (só admin) tudo vale para os atendimentos daquele atendente.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"viewAsAttendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["from","to"]},"example":{"from":"2026-10-17T00:00:00-03:00","to":"2026-10-24T23:59:59-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"bucketKind":{"type":"string","enum":["hour","day"]},"total":{"type":"number"},"volume":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"count":{"type":"number"}},"required":["bucket","count"],"additionalProperties":false}},"byChannel":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"count":{"type":"number"}},"required":["kind","count"],"additionalProperties":false}},"avgFirstResponseSeconds":{"type":["number","null"]},"avgResolutionSeconds":{"type":["number","null"]},"responseBuckets":{"type":"object","properties":{"kind":{"type":"string","enum":["hour","weekday"]},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"number"},"avgSeconds":{"type":["number","null"]},"count":{"type":"number"}},"required":["key","avgSeconds","count"],"additionalProperties":false}}},"required":["kind","items"],"additionalProperties":false},"recentActivity":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"action":{"type":"string","enum":["assigned","unassigned","transferred","resolved","reopened","priority"]},"conversationId":{"type":"string"},"contactName":{"type":["string","null"]},"userId":{"type":["string","null"]},"userName":{"type":["string","null"]}},"required":["at","action","conversationId","contactName","userId","userName"],"additionalProperties":false}},"byAttendant":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]},"attended":{"type":"number"},"resolved":{"type":"number"},"avgFirstResponseSeconds":{"type":["number","null"]}},"required":["userId","name","attended","resolved","avgFirstResponseSeconds"],"additionalProperties":false}}},"required":["timezone","bucketKind","total","volume","byChannel","avgFirstResponseSeconds","avgResolutionSeconds","responseBuckets","recentActivity","byAttendant"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.dashboard_attendant":{"post":{"operationId":"inbox.dashboard_attendant","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.dashboard_attendant.md"},"x-mcp-tool":"inbox_dashboard_attendant","x-cli":"node cli/atomiks.mjs inbox.dashboard_attendant --json '{...}'","x-session-only":false,"summary":"Atendente do cartão do painel do atendimento","description":"Id, nome e foto (`avatarUrl`, null sem foto) do atendente do cartão do painel: o próprio chamador ou, só admin, o indicado em `viewAsAttendantId`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"viewAsAttendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]}},"required":["userId","name","avatarUrl"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.pipelines_overview":{"post":{"operationId":"crm.pipelines_overview","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.pipelines_overview.md"},"x-mcp-tool":"crm_pipelines_overview","x-cli":"node cli/atomiks.mjs crm.pipelines_overview --json '{...}'","x-session-only":false,"summary":"Visão geral dos pipelines","description":"Indicadores das oportunidades que o chamador vê, de um pipeline (`pipelineId`) ou de todos: `kpis` (total, abertas e valor em aberto, ganhas e perdidas no período `from`..`to` com valor ganho, `conversionRate` = ganhas ÷ (ganhas + perdidas) em %, `avgCycleDays` da criação ao ganho), `ranking` por responsável (ordenado pelo valor ganho no período), `atRisk` (abertas sem movimento há `riskDays` dias, padrão 14, ou com `expectedCloseDate` vencida; até 50, mais paradas primeiro) e `lostReasons` (perdidas no período por `lost_reason`; `reason` null = sem motivo). Também devolve o que a Visão geral de oportunidades mostra: `pipelines` (contagens e valores por pipeline, para a lista lateral), `temperature` (abertas em quente, morno, frio e congelado: banda do contato; parada há 30 dias ou mais conta como congelada) e `activityMix` (tarefas criadas no período por tipo e as ligações concluídas). Em `atRisk`, `priority` é `high` (ação vencida ou parada há o dobro de `riskDays`) ou `attention`. Em `ranking`, `activities` são as tarefas do responsável criadas no período. Valores em centavos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"riskDays":{"type":"integer","minimum":1,"maximum":365}},"required":["from","to"]},"example":{"from":"2026-10-01T00:00:00-03:00","to":"2026-10-31T23:59:59-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kpis":{"type":"object","properties":{"total":{"type":"number"},"open":{"type":"number"},"openValueCents":{"type":"number"},"won":{"type":"number"},"wonValueCents":{"type":"number"},"lost":{"type":"number"},"conversionRate":{"type":["number","null"]},"avgCycleDays":{"type":["number","null"]}},"required":["total","open","openValueCents","won","wonValueCents","lost","conversionRate","avgCycleDays"],"additionalProperties":false},"ranking":{"type":"array","items":{"type":"object","properties":{"userId":{"type":["string","null"]},"name":{"type":["string","null"]},"open":{"type":"number"},"won":{"type":"number"},"lost":{"type":"number"},"conversionRate":{"type":["number","null"]},"wonValueCents":{"type":"number"},"avgCycleDays":{"type":["number","null"]},"activities":{"type":"number"}},"required":["userId","name","open","won","lost","conversionRate","wonValueCents","avgCycleDays","activities"],"additionalProperties":false}},"atRisk":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"pipelineId":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"ownerId":{"type":["string","null"]},"valueCents":{"type":"number"},"daysIdle":{"type":"number"},"expectedCloseDate":{"type":["string","null"]},"reasons":{"type":"array","items":{"type":"string","enum":["stalled","overdue"]}},"pipelineName":{"type":["string","null"]},"ownerName":{"type":["string","null"]},"noNextAction":{"type":"boolean"},"isFrozen":{"type":"boolean"},"priority":{"type":"string","enum":["high","attention"]}},"required":["id","title","pipelineId","contactId","contactName","ownerId","valueCents","daysIdle","expectedCloseDate","reasons","pipelineName","ownerName","noNextAction","isFrozen","priority"],"additionalProperties":false}},"atRiskTotal":{"type":"number"},"lostReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":["string","null"]},"count":{"type":"number"},"valueCents":{"type":"number"}},"required":["reason","count","valueCents"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"number"},"open":{"type":"number"},"openValueCents":{"type":"number"},"won":{"type":"number"},"wonValueCents":{"type":"number"},"lost":{"type":"number"},"lostValueCents":{"type":"number"}},"required":["id","name","total","open","openValueCents","won","wonValueCents","lost","lostValueCents"],"additionalProperties":false}},"temperature":{"type":"object","properties":{"hot":{"type":"number"},"warm":{"type":"number"},"cold":{"type":"number"},"frozen":{"type":"number"}},"required":["hot","warm","cold","frozen"],"additionalProperties":false},"activityMix":{"type":"object","properties":{"calls":{"type":"number"},"whatsapp":{"type":"number"},"meetings":{"type":"number"},"notes":{"type":"number"},"callsAnswered":{"type":"number"},"callsTotal":{"type":"number"}},"required":["calls","whatsapp","meetings","notes","callsAnswered","callsTotal"],"additionalProperties":false}},"required":["kpis","ranking","atRisk","atRiskTotal","lostReasons","pipelines","temperature","activityMix"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me.profile_get":{"post":{"operationId":"me.profile_get","tags":["me"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/me.profile_get.md"},"x-mcp-tool":"me_profile_get","x-cli":"node cli/atomiks.mjs me.profile_get --json '{...}'","x-session-only":false,"summary":"Ver meu perfil","description":"Nome, e-mail e foto (`avatarUrl`, null sem foto) do usuário autenticado (\"Meu perfil\").","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"avatarUrl":{"type":["string","null"]}},"required":["name","email","avatarUrl"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me.profile_update":{"post":{"operationId":"me.profile_update","tags":["me"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/me.profile_update.md"},"x-mcp-tool":"me_profile_update","x-cli":"node cli/atomiks.mjs me.profile_update --json '{...}'","x-session-only":false,"summary":"Alterar meu perfil","description":"Altera nome e/ou foto do próprio usuário. `avatarUrl` é um endereço https ou uma imagem PNG/JPEG/WebP em data URL (até ~200 KB); null remove a foto. Campos omitidos não mudam.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"avatarUrl":{"anyOf":[{"type":"string","maxLength":280000},{"type":"null"}]}}},"example":{"name":"Ana Souza"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"avatarUrl":{"type":["string","null"]}},"required":["name","email","avatarUrl"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendars.list":{"post":{"operationId":"calendars.list","tags":["calendars"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/calendars.list.md"},"x-mcp-tool":"calendars_list","x-cli":"node cli/atomiks.mjs calendars.list --json '{...}'","x-session-only":false,"summary":"Listar calendários de atendimento","description":"Calendários de horário da conta: nome, fuso, principal (só um), horários por dia da semana (`mon`..`sun`, intervalos `[\"09:00\",\"12:00\"]`) e exceções por data (`closed`, `open` o dia todo ou `range` com `start`/`end`).","x-scope":"account:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"isDefault":{"type":"boolean"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["closed","open","range"]},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","mode"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","timezone","isDefault","weekly","exceptions","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendars.create":{"post":{"operationId":"calendars.create","tags":["calendars"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/calendars.create.md"},"x-mcp-tool":"calendars_create","x-cli":"node cli/atomiks.mjs calendars.create --json '{...}'","x-session-only":false,"summary":"Criar calendário de atendimento","description":"Cria um calendário. O primeiro da conta vira o principal; `isDefault: true` troca o principal.","x-scope":"account:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"timezone":{"type":"string","maxLength":64},"isDefault":{"type":"boolean"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"exceptions":{"maxItems":366,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["closed","open","range"]},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","mode"]}}},"required":["name"]},"example":{"name":"Comercial","weekly":{"mon":[["09:00","18:00"]]}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"isDefault":{"type":"boolean"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["closed","open","range"]},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","mode"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","timezone","isDefault","weekly","exceptions","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendars.update":{"post":{"operationId":"calendars.update","tags":["calendars"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/calendars.update.md"},"x-mcp-tool":"calendars_update","x-cli":"node cli/atomiks.mjs calendars.update --json '{...}'","x-session-only":false,"summary":"Alterar calendário de atendimento","description":"Altera nome, fuso, horários ou exceções. `isDefault: true` torna este o principal; o principal não pode ser desmarcado direto (marque outro).","x-scope":"account:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"timezone":{"type":"string","maxLength":64},"isDefault":{"type":"boolean"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"exceptions":{"maxItems":366,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["closed","open","range"]},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","mode"]}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Plantão"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"isDefault":{"type":"boolean"},"weekly":{"type":"object","properties":{"mon":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"maxItems":8,"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}],"items":false,"minItems":2,"maxItems":2}}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["closed","open","range"]},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["date","mode"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","timezone","isDefault","weekly","exceptions","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendars.delete":{"post":{"operationId":"calendars.delete","tags":["calendars"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/calendars.delete.md"},"x-mcp-tool":"calendars_delete","x-cli":"node cli/atomiks.mjs calendars.delete --json '{...}'","x-session-only":false,"summary":"Excluir calendário de atendimento","description":"Exclui o calendário. O principal só pode ser excluído se for o único.","x-scope":"account:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/push.config":{"post":{"operationId":"push.config","tags":["push"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/push.config.md"},"x-mcp-tool":"push_config","x-cli":"node cli/atomiks.mjs push.config --json '{...}'","x-session-only":false,"summary":"Configuração do Web Push","description":"Chave pública VAPID (`publicKey`) para o navegador assinar o push. `null` quando o servidor não tem chaves: a tela deve esconder o push.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"publicKey":{"type":["string","null"]}},"required":["publicKey"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/push.subscribe":{"post":{"operationId":"push.subscribe","tags":["push"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/push.subscribe.md"},"x-mcp-tool":"push_subscribe","x-cli":"node cli/atomiks.mjs push.subscribe --json '{...}'","x-session-only":false,"summary":"Ativar push neste navegador","description":"Guarda a assinatura Web Push (`PushSubscription.toJSON()`) do usuário. Repetir o mesmo `endpoint` atualiza as chaves.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"endpoint":{"type":"string","maxLength":2000,"format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":1,"maxLength":200},"auth":{"type":"string","minLength":1,"maxLength":100}},"required":["p256dh","auth"]},"userAgent":{"type":"string","maxLength":300}},"required":["endpoint","keys"]},"example":{"endpoint":"https://push.example.com/abc","keys":{"p256dh":"BKey","auth":"secret"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/push.unsubscribe":{"post":{"operationId":"push.unsubscribe","tags":["push"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/push.unsubscribe.md"},"x-mcp-tool":"push_unsubscribe","x-cli":"node cli/atomiks.mjs push.unsubscribe --json '{...}'","x-session-only":false,"summary":"Desativar push neste navegador","description":"Apaga a assinatura Web Push do usuário com esse `endpoint`. Se não existir, nada acontece.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"endpoint":{"type":"string","maxLength":2000,"format":"uri"}},"required":["endpoint"]},"example":{"endpoint":"https://push.example.com/abc"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.catalog":{"post":{"operationId":"flows.catalog","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.catalog.md"},"x-mcp-tool":"flows_catalog","x-cli":"node cli/atomiks.mjs flows.catalog --json '{...}'","x-session-only":false,"summary":"Catálogo de eventos e nós dos flows","description":"Eventos que iniciam ou encerram um flow (com filtros e canais aceitos) e os tipos de nó, cada um com um exemplo de configuração e os handles de saída. As arestas do grafo usam `sourceHandle` igual a um desses handles; `send_message` só tem `btn:<id>`, `reply` e `no_reply` quando tem `waitReply`.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"},"filters":{"type":"array","items":{}},"channels":{"type":"array","items":{"type":"string"}}},"required":["name","label","group","filters"],"additionalProperties":false}},"nodeTypes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"handles":{"type":"array","items":{"type":"string"}},"sample":{}},"required":["type","handles","sample"],"additionalProperties":false}}},"required":["events","nodeTypes"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.list":{"post":{"operationId":"flows.list","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.list.md"},"x-mcp-tool":"flows_list","x-cli":"node cli/atomiks.mjs flows.list --json '{...}'","x-session-only":false,"summary":"Listar flows","description":"Flows da conta, do mais recente para o mais antigo. Arquivados só com `includeArchived`. `status` filtra. Cada item traz o resumo da versão mais recente: `steps` (nós), `startEvent` (primeiro evento de início ou null), `runs` (execuções de todas as versões) e `layout` (posições e ligações para a miniatura).","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["draft","active","paused","archived"]},"includeArchived":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"number"},"startEvent":{"type":["string","null"]},"runs":{"type":"number"},"layout":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"required":["id","type","x","y"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false}}},"required":["nodes","edges"],"additionalProperties":false}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt","steps","startEvent","runs","layout"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.get":{"post":{"operationId":"flows.get","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.get.md"},"x-mcp-tool":"flows_get","x-cli":"node cli/atomiks.mjs flows.get --json '{...}'","x-session-only":false,"summary":"Ver flow","description":"O flow com o rascunho atual (`draft`, a versão mais recente se ainda não publicada) e a versão publicada (`published`).","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"draft":{"anyOf":[{"type":"object","properties":{"version":{"type":"number"},"graph":{},"published":{"type":"boolean"},"publishedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["version","graph","published","publishedAt","createdAt"],"additionalProperties":false},{"type":"null"}]},"published":{"anyOf":[{"type":"object","properties":{"version":{"type":"number"},"graph":{},"published":{"type":"boolean"},"publishedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["version","graph","published","publishedAt","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt","draft","published"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.create":{"post":{"operationId":"flows.create","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.create.md"},"x-mcp-tool":"flows_create","x-cli":"node cli/atomiks.mjs flows.create --json '{...}'","x-session-only":false,"summary":"Criar flow","description":"Cria um flow em rascunho (versão 1). Sem `graph`, começa só com o nó de gatilho vazio.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"folder":{"type":"string","minLength":1,"maxLength":120},"graph":{"description":"Grafo do flow: {schema: 1, nodes, edges}. Veja flows.catalog para os tipos de nó e handles."}},"required":["name"]},"example":{"name":"Boas-vindas"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.save_draft":{"post":{"operationId":"flows.save_draft","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.save_draft.md"},"x-mcp-tool":"flows_save_draft","x-cli":"node cli/atomiks.mjs flows.save_draft --json '{...}'","x-session-only":false,"summary":"Salvar rascunho do flow","description":"Grava o grafo no rascunho (a versão mais recente, se não publicada; senão cria a próxima versão). `expectedVersion` é o número da versão mais recente que você leu (0 se o flow não tinha versões); se outra pessoa já avançou, devolve conflito (409). A validação completa só acontece ao publicar.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"graph":{"description":"Grafo do flow: {schema: 1, nodes, edges}. Veja flows.catalog para os tipos de nó e handles."},"expectedVersion":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","graph"]},"example":{"id":"00000000-0000-0000-0000-000000000000","graph":{"schema":1,"nodes":[{"id":"trigger","type":"trigger","position":{"x":0,"y":0},"config":{"start":[],"exit":[]}}],"edges":[]},"expectedVersion":1}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"nodeId":{"type":"string"},"edgeId":{"type":"string"}},"required":["code","message"],"additionalProperties":false}}},"required":["id","version","warnings"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.rename":{"post":{"operationId":"flows.rename","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.rename.md"},"x-mcp-tool":"flows_rename","x-cli":"node cli/atomiks.mjs flows.rename --json '{...}'","x-session-only":false,"summary":"Renomear flow","description":"Muda só o nome do flow; não cria versão nem mexe no grafo.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["id","name"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Novo nome"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.versions":{"post":{"operationId":"flows.versions","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.versions.md"},"x-mcp-tool":"flows_versions","x-cli":"node cli/atomiks.mjs flows.versions --json '{...}'","x-session-only":false,"summary":"Versões do flow","description":"Até 50 versões do flow, da mais nova para a mais antiga (sem o grafo).","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["flowId"]},"example":{"flowId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"published":{"type":"boolean"},"publishedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","version","published","publishedAt","createdAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.restore_version":{"post":{"operationId":"flows.restore_version","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.restore_version.md"},"x-mcp-tool":"flows_restore_version","x-cli":"node cli/atomiks.mjs flows.restore_version --json '{...}'","x-session-only":false,"summary":"Restaurar versão do flow","description":"Copia o grafo de uma versão antiga para o rascunho: regrava o rascunho atual ou, se a mais recente está publicada, cria a próxima versão. Devolve o número da versão do rascunho.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"versionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["flowId","versionId"]},"example":{"flowId":"00000000-0000-0000-0000-000000000000","versionId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"number"}},"required":["version"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.publish":{"post":{"operationId":"flows.publish","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.publish.md"},"x-mcp-tool":"flows_publish","x-cli":"node cli/atomiks.mjs flows.publish --json '{...}'","x-session-only":false,"summary":"Publicar flow","description":"Valida o rascunho (grafo e gatilhos), marca a versão como publicada (a anterior deixa de ser), regrava os gatilhos de início e saída e deixa o flow `active`. Grafo inválido devolve `invalid_input` com a lista de problemas na mensagem. Runs vivos seguem na versão em que começaram.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","const":"active"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"nodeId":{"type":"string"},"edgeId":{"type":"string"}},"required":["code","message"],"additionalProperties":false}}},"required":["id","version","status","warnings"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.pause":{"post":{"operationId":"flows.pause","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.pause.md"},"x-mcp-tool":"flows_pause","x-cli":"node cli/atomiks.mjs flows.pause --json '{...}'","x-session-only":false,"summary":"Pausar flow","description":"Para de iniciar runs novos (gatilhos de início desligados). Os runs vivos continuam até o fim.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.resume":{"post":{"operationId":"flows.resume","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.resume.md"},"x-mcp-tool":"flows_resume","x-cli":"node cli/atomiks.mjs flows.resume --json '{...}'","x-session-only":false,"summary":"Retomar flow","description":"Volta um flow pausado para ativo e religa os gatilhos de início.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.archive":{"post":{"operationId":"flows.archive","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.archive.md"},"x-mcp-tool":"flows_archive","x-cli":"node cli/atomiks.mjs flows.archive --json '{...}'","x-session-only":false,"summary":"Arquivar flow","description":"Tira o flow da lista e desliga todos os gatilhos. Runs vivos não são cancelados (use flow_runs.cancel).","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.duplicate":{"post":{"operationId":"flows.duplicate","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.duplicate.md"},"x-mcp-tool":"flows_duplicate","x-cli":"node cli/atomiks.mjs flows.duplicate --json '{...}'","x-session-only":false,"summary":"Duplicar flow","description":"Cria um flow novo em rascunho com o grafo da versão mais recente. Sem `name`, usa \"<nome> (cópia)\".","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.export":{"post":{"operationId":"flows.export","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.export.md"},"x-mcp-tool":"flows_export","x-cli":"node cli/atomiks.mjs flows.export --json '{...}'","x-session-only":false,"summary":"Exportar flow","description":"JSON `{schema, name, graph}` da versão mais recente, para importar em outra conta.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"schema":{"type":"number","const":1},"name":{"type":"string"},"graph":{}},"required":["schema","name","graph"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.import":{"post":{"operationId":"flows.import","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.import.md"},"x-mcp-tool":"flows_import","x-cli":"node cli/atomiks.mjs flows.import --json '{...}'","x-session-only":false,"summary":"Importar flow","description":"Cria um rascunho a partir do JSON de `flows.export`. `name` substitui o nome do arquivo.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"schema":{"type":"number","const":1},"name":{"type":"string","minLength":1,"maxLength":120},"graph":{"description":"Grafo do flow: {schema: 1, nodes, edges}. Veja flows.catalog para os tipos de nó e handles."}},"required":["schema","name","graph"]},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["data"]},"example":{"data":{"schema":1,"name":"Boas-vindas","graph":{"schema":1,"nodes":[{"id":"trigger","type":"trigger","position":{"x":0,"y":0},"config":{"start":[],"exit":[]}}],"edges":[]}}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"publishedVersion":{"type":["number","null"]},"folder":{"type":["string","null"]},"latestVersion":{"type":["number","null"]},"hasDraft":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","status","publishedVersion","folder","latestVersion","hasDraft","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.test_run":{"post":{"operationId":"flows.test_run","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.test_run.md"},"x-mcp-tool":"flows_test_run","x-cli":"node cli/atomiks.mjs flows.test_run --json '{...}'","x-session-only":false,"summary":"Testar flow num contato","description":"Inicia um run do flow publicado no contato escolhido, ignorando os gatilhos. Falha se o contato já está no flow.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","contactId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"}},"required":["id","runId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flow_runs.list":{"post":{"operationId":"flow_runs.list","tags":["flow_runs"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flow_runs.list.md"},"x-mcp-tool":"flow_runs_list","x-cli":"node cli/atomiks.mjs flow_runs.list --json '{...}'","x-session-only":false,"summary":"Listar execuções de flows","description":"Execuções do mais recente para o mais antigo. Filtros: `flowId`, `status`, `contactId`. Use `before` (o `nextBefore` anterior) para a página seguinte.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["running","waiting_reply","waiting_delay","completed","failed","canceled","expired"]},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"before":{"type":"string"}}},"example":{"status":"failed","limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"flowId":{"type":"string"},"flowVersionId":{"type":"string"},"contactId":{"type":"string"},"conversationId":{"type":["string","null"]},"channelId":{"type":["string","null"]},"status":{"type":"string"},"currentNodeId":{"type":["string","null"]},"vars":{},"lastError":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","flowId","flowVersionId","contactId","conversationId","channelId","status","currentNodeId","vars","lastError","createdAt","updatedAt","finishedAt"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flow_runs.get":{"post":{"operationId":"flow_runs.get","tags":["flow_runs"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flow_runs.get.md"},"x-mcp-tool":"flow_runs_get","x-cli":"node cli/atomiks.mjs flow_runs.get --json '{...}'","x-session-only":false,"summary":"Ver execução de flow","description":"A execução com todos os passos (diário), na ordem em que rodaram.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"flowId":{"type":"string"},"flowVersionId":{"type":"string"},"contactId":{"type":"string"},"conversationId":{"type":["string","null"]},"channelId":{"type":["string","null"]},"status":{"type":"string"},"currentNodeId":{"type":["string","null"]},"vars":{},"lastError":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"nodeType":{"type":"string"},"attempt":{"type":"number"},"status":{"type":"string"},"handle":{"type":["string","null"]},"output":{},"error":{"type":["string","null"]},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","nodeId","nodeType","attempt","status","handle","output","error","startedAt","finishedAt"],"additionalProperties":false}}},"required":["id","flowId","flowVersionId","contactId","conversationId","channelId","status","currentNodeId","vars","lastError","createdAt","updatedAt","finishedAt","steps"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flow_runs.cancel":{"post":{"operationId":"flow_runs.cancel","tags":["flow_runs"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flow_runs.cancel.md"},"x-mcp-tool":"flow_runs_cancel","x-cli":"node cli/atomiks.mjs flow_runs.cancel --json '{...}'","x-session-only":false,"summary":"Cancelar execução de flow","description":"Cancela uma execução viva (rodando ou em espera). `reason` fica registrado no run.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"default":"Cancelado manualmente","type":"string","minLength":1,"maxLength":300}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","reason":"Contato pediu para parar"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"canceled"}},"required":["id","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flow_runs.retry_step":{"post":{"operationId":"flow_runs.retry_step","tags":["flow_runs"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flow_runs.retry_step.md"},"x-mcp-tool":"flow_runs_retry_step","x-cli":"node cli/atomiks.mjs flow_runs.retry_step --json '{...}'","x-session-only":false,"summary":"Repetir passo de uma execução","description":"Recomeça uma execução a partir do nó informado (`nodeId`), por exemplo depois de uma falha.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"nodeId":{"type":"string","minLength":1}},"required":["id","nodeId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","nodeId":"n1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"}},"required":["id","nodeId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/flows.stats":{"post":{"operationId":"flows.stats","tags":["flows"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/flows.stats.md"},"x-mcp-tool":"flows_stats","x-cli":"node cli/atomiks.mjs flows.stats --json '{...}'","x-session-only":false,"summary":"Números por passo do flow","description":"Execuções do período (padrão: últimos 30 dias) da versão publicada, ou de `versionId`. `nodes[nodeId]`: `entered` = execuções distintas que passaram pelo nó, `handles` = quantas saíram por cada handle, `failed` = passos com falha. Lê até 20 000 execuções; acima disso `truncated` fica true e vale só para as mais recentes.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"versionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["flowId"]},"example":{"flowId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"total":{"type":"object","properties":{"started":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"},"live":{"type":"number"}},"required":["started","completed","failed","live"],"additionalProperties":false},"nodes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"entered":{"type":"number"},"handles":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"failed":{"type":"number"}},"required":["entered","handles","failed"],"additionalProperties":false}},"truncated":{"type":"boolean"}},"required":["total","nodes","truncated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.catalog":{"post":{"operationId":"integrations.catalog","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.catalog.md"},"x-mcp-tool":"integrations_catalog","x-cli":"node cli/atomiks.mjs integrations.catalog --json '{...}'","x-session-only":false,"summary":"Catálogo de conectores","description":"Conectores disponíveis (Hotmart, Kiwify, webhooks, Zapier, Make, n8n) com categoria, direção, tipo de segredo e passos de configuração.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"category":{"type":"string","enum":["vendas","automacao","webhook"]},"direction":{"type":"string","enum":["in","out"]},"secret":{"type":"string","enum":["required","generated","none"]},"setup":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"string"}},"docsUrl":{"type":"string"}},"required":["steps"],"additionalProperties":false}},"required":["key","label","category","direction","secret","setup"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.list":{"post":{"operationId":"integrations.list","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.list.md"},"x-mcp-tool":"integrations_list","x-cli":"node cli/atomiks.mjs integrations.list --json '{...}'","x-session-only":false,"summary":"Listar integrações","description":"Integrações da conta, da mais recente para a mais antiga, com contadores das últimas 24 horas. O segredo nunca é devolvido, só os 4 últimos caracteres (`secretHint`).","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connector":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"secretHint":{"type":["string","null"]},"lastEventAt":{"type":["string","null"]},"createdAt":{"type":"string"},"counts":{"type":"object","properties":{"events24h":{"type":"number"},"failed24h":{"type":"number"},"total":{"type":"number"}},"required":["events24h","failed24h"],"additionalProperties":false},"url":{"type":["string","null"]},"triggers":{"type":"array","items":{"type":"string"}}},"required":["id","connector","name","status","secretHint","lastEventAt","createdAt","counts"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.get":{"post":{"operationId":"integrations.get","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.get.md"},"x-mcp-tool":"integrations_get","x-cli":"node cli/atomiks.mjs integrations.get --json '{...}'","x-session-only":false,"summary":"Ver uma integração","description":"Dados da integração, URL de entrada (nula nas de saída) e configuração. O segredo nunca é devolvido.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"connector":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"secretHint":{"type":["string","null"]},"lastEventAt":{"type":["string","null"]},"createdAt":{"type":"string"},"counts":{"type":"object","properties":{"events24h":{"type":"number"},"failed24h":{"type":"number"},"total":{"type":"number"}},"required":["events24h","failed24h"],"additionalProperties":false},"url":{"type":["string","null"]},"triggers":{"type":"array","items":{"type":"string"}},"inboundUrl":{"type":["string","null"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","connector","name","status","secretHint","lastEventAt","createdAt","counts","inboundUrl","config"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.create":{"post":{"operationId":"integrations.create","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.create.md"},"x-mcp-tool":"integrations_create","x-cli":"node cli/atomiks.mjs integrations.create --json '{...}'","x-session-only":false,"summary":"Criar integração","description":"Hotmart e Kiwify exigem `secret` (hottok ou token). Webhook de entrada e conectores de saída geram o segredo, devolvido uma única vez nesta resposta. Config: saída `{url (https), events}`; webhook_in `{mapping: {phone, email, name, externalId}}`; Hotmart/Kiwify `{channelId}`.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connector":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","minLength":1,"maxLength":80},"secret":{"type":"string","minLength":8,"maxLength":200},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["connector","name"]},"example":{"connector":"hotmart","name":"Hotmart","secret":"meu-hottok-123"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"},"inboundUrl":{"type":["string","null"]}},"required":["id","inboundUrl"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.update":{"post":{"operationId":"integrations.update","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.update.md"},"x-mcp-tool":"integrations_update","x-cli":"node cli/atomiks.mjs integrations.update --json '{...}'","x-session-only":false,"summary":"Editar integração","description":"Muda nome, configuração (substitui a anterior) ou o segredo de Hotmart e Kiwify. Nos conectores com segredo gerado use `integrations.rotate_secret`.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secret":{"type":"string","minLength":8,"maxLength":200}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Novo nome"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.set_status":{"post":{"operationId":"integrations.set_status","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.set_status.md"},"x-mcp-tool":"integrations_set_status","x-cli":"node cli/atomiks.mjs integrations.set_status --json '{...}'","x-session-only":false,"summary":"Pausar ou retomar integração","description":"Pausada: a entrada responde 200 e ignora os eventos; a saída para de enfileirar.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused"]}},"required":["id","status"]},"example":{"id":"00000000-0000-0000-0000-000000000000","status":"paused"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.delete":{"post":{"operationId":"integrations.delete","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.delete.md"},"x-mcp-tool":"integrations_delete","x-cli":"node cli/atomiks.mjs integrations.delete --json '{...}'","x-session-only":false,"summary":"Apagar integração","description":"Apaga a integração com os eventos, entregas e produtos dela. Não tem volta.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.rotate_secret":{"post":{"operationId":"integrations.rotate_secret","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.rotate_secret.md"},"x-mcp-tool":"integrations_rotate_secret","x-cli":"node cli/atomiks.mjs integrations.rotate_secret --json '{...}'","x-session-only":false,"summary":"Gerar novo segredo","description":"Só para webhook de entrada e conectores de saída. O segredo antigo deixa de valer e o novo é devolvido uma única vez.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}},"required":["id","secret"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.events":{"post":{"operationId":"integrations.events","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.events.md"},"x-mcp-tool":"integrations_events","x-cli":"node cli/atomiks.mjs integrations.events --json '{...}'","x-session-only":false,"summary":"Eventos recebidos","description":"Últimos 100 eventos recebidos por uma integração de entrada, sem o corpo (use `integrations.get_event`). `before` pagina por data de recebimento.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"description":"Cursor: `nextBefore` da página anterior (data ISO).","type":"string"}},"required":["integrationId"]},"example":{"integrationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"rawEvent":{"type":["string","null"]},"eventName":{"type":["string","null"]},"status":{"type":"string","enum":["pending","processed","ignored","failed"]},"error":{"type":["string","null"]},"receivedAt":{"type":"string"},"processedAt":{"type":["string","null"]},"contactId":{"type":["string","null"]}},"required":["id","rawEvent","eventName","status","error","receivedAt","processedAt","contactId"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.get_event":{"post":{"operationId":"integrations.get_event","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.get_event.md"},"x-mcp-tool":"integrations_get_event","x-cli":"node cli/atomiks.mjs integrations.get_event --json '{...}'","x-session-only":false,"summary":"Ver um evento recebido","description":"Evento recebido com o corpo normalizado (`payload`), que traz dados pessoais do comprador.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"},"rawEvent":{"type":["string","null"]},"eventName":{"type":["string","null"]},"status":{"type":"string","enum":["pending","processed","ignored","failed"]},"error":{"type":["string","null"]},"receivedAt":{"type":"string"},"processedAt":{"type":["string","null"]},"contactId":{"type":["string","null"]},"payload":{}},"required":["id","integrationId","rawEvent","eventName","status","error","receivedAt","processedAt","contactId","payload"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.reprocess":{"post":{"operationId":"integrations.reprocess","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.reprocess.md"},"x-mcp-tool":"integrations_reprocess","x-cli":"node cli/atomiks.mjs integrations.reprocess --json '{...}'","x-session-only":false,"summary":"Reprocessar evento recebido","description":"Volta o evento para a fila (`pending`, tentativas zeradas). Reprocessar um evento já processado não dispara o flow de novo (dedupe por evento).","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.deliveries":{"post":{"operationId":"integrations.deliveries","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.deliveries.md"},"x-mcp-tool":"integrations_deliveries","x-cli":"node cli/atomiks.mjs integrations.deliveries --json '{...}'","x-session-only":false,"summary":"Entregas de saída","description":"Últimas 100 entregas de uma integração de saída. `before` pagina por data de criação.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"description":"Cursor: `nextBefore` da página anterior (data ISO).","type":"string"}},"required":["integrationId"]},"example":{"integrationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"status":{"type":"string","enum":["pending","sending","sent","failed"]},"attempts":{"type":"number"},"responseStatus":{"type":["number","null"]},"lastError":{"type":["string","null"]},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]}},"required":["id","eventName","status","attempts","responseStatus","lastError","createdAt","sentAt"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.test":{"post":{"operationId":"integrations.test","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.test.md"},"x-mcp-tool":"integrations_test","x-cli":"node cli/atomiks.mjs integrations.test --json '{...}'","x-session-only":false,"summary":"Enviar teste","description":"Só integrações de saída: envia agora o evento `test.ping.v1` assinado para a URL configurada, fora da fila.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"number"},"error":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.products":{"post":{"operationId":"integrations.products","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.products.md"},"x-mcp-tool":"integrations_products","x-cli":"node cli/atomiks.mjs integrations.products --json '{...}'","x-session-only":false,"summary":"Produtos das plataformas","description":"Produtos vistos nas vendas recebidas (`external_products`), para o filtro \"Produto da plataforma\" dos gatilhos. `integrationId` restringe a uma integração.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"},"externalId":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","integrationId","externalId","name"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_endpoints":{"post":{"operationId":"channels.evolution_endpoints","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_endpoints.md"},"x-mcp-tool":"channels_evolution_endpoints","x-cli":"node cli/atomiks.mjs channels.evolution_endpoints --json '{...}'","x-session-only":false,"summary":"Listar as rotas da Evolution disponíveis para números por QR","description":"Catálogo completo das rotas por instância da Evolution API (2.3.7): instância, envio, conversas, grupos, etiquetas, perfil, privacidade, proxy, eventos, chatbots, Chatwoot e S3. Cada uma é chamada por `channels.evolution_call`. `blocked` diz por que a rota não é chamada direto e qual operação do Atomiks faz o mesmo.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"path":{"type":"string"},"group":{"type":"string"},"blocked":{"type":["string","null"]}},"required":["method","path","group","blocked"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.evolution_call":{"post":{"operationId":"channels.evolution_call","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.evolution_call.md"},"x-mcp-tool":"channels_evolution_call","x-cli":"node cli/atomiks.mjs channels.evolution_call --json '{...}'","x-session-only":false,"summary":"Chamar qualquer rota da Evolution num número por QR","description":"Repassa a chamada à instância da Evolution do canal `whatsapp_web`, com o token dela: o Atomiks põe o `:instanceName`, você manda `method`, `path` (como em `channels.evolution_endpoints`, ex. `group/participants`), `params` (parâmetros de caminho, ex. `{typebotId}`), `query` e `body` exatamente como na documentação da Evolution. Devolve a resposta da Evolution sem mudar nada. Erro 4xx da Evolution vira `invalid_input` com a mensagem dela. Envio por `message/send*` fica gravado na conversa do atendimento (como mensagem do celular).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"path":{"type":"string","minLength":1,"maxLength":200},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"body":{}},"required":["channelId","method","path"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","method":"GET","path":"group/participants","query":{"groupJid":"120363000000000000@g.us"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"response":{}},"required":["response"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.waha_endpoints":{"post":{"operationId":"channels.waha_endpoints","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.waha_endpoints.md"},"x-mcp-tool":"channels_waha_endpoints","x-cli":"node cli/atomiks.mjs channels.waha_endpoints --json '{...}'","x-session-only":false,"summary":"Listar as rotas do servidor novo disponíveis para números por QR","description":"Catálogo completo das rotas por sessão do servidor de números por QR novo (WAHA 2026.10.1): sessão, envio, conversas, grupos, canais, status, etiquetas, contatos, presença, mídia, eventos e privacidade. Cada uma é chamada por `channels.waha_call`. `blocked` diz por que a rota não é chamada direto e qual operação do Atomiks faz o mesmo. Vale para números cujo `channels.list` mostra o servidor novo; os demais usam `channels.evolution_endpoints`.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"path":{"type":"string"},"group":{"type":"string"},"blocked":{"type":["string","null"]}},"required":["method","path","group","blocked"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channels.waha_call":{"post":{"operationId":"channels.waha_call","tags":["channels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channels.waha_call.md"},"x-mcp-tool":"channels_waha_call","x-cli":"node cli/atomiks.mjs channels.waha_call --json '{...}'","x-session-only":false,"summary":"Chamar qualquer rota do servidor novo num número por QR","description":"Repassa a chamada à sessão do canal `whatsapp_web` no servidor novo (WAHA), com a chave da sessão: o Atomiks põe a sessão (`:session` do caminho e o campo `session` do corpo/query), você manda `method`, `path` (como em `channels.waha_endpoints`, ex. `api/:session/groups`), `params` (outros parâmetros de caminho, ex. `{chatId}`), `query` e `body` como na documentação do WAHA. Mandar `session` de outro número dá `invalid_input`. Devolve a resposta do servidor sem mudar nada; erro 4xx vira `invalid_input` com a mensagem dele. Número que usa o servidor anterior responde `invalid_input`: use `channels.evolution_call`.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"path":{"type":"string","minLength":1,"maxLength":200},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","minLength":1,"maxLength":200}},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"body":{}},"required":["channelId","method","path"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","method":"GET","path":"api/:session/groups"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"response":{}},"required":["response"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.group_participants":{"post":{"operationId":"inbox.group_participants","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.group_participants.md"},"x-mcp-tool":"inbox_group_participants","x-cli":"node cli/atomiks.mjs inbox.group_participants --json '{...}'","x-session-only":false,"summary":"Participantes de um grupo do WhatsApp","description":"Lista quem está no grupo da conversa (número por QR), com telefone quando o WhatsApp informa (quem aparece só por `@lid` vem sem), nome salvo no Atomiks ou o do WhatsApp, e papel (`member`, `admin`, `superadmin`). `canManage` = o número conectado é administrador do grupo (pode adicionar, remover, promover e rebaixar por `inbox.group_participants_update`).","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["conversationId"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"phone":{"type":["string","null"]},"name":{"type":["string","null"]},"role":{"type":"string","enum":["member","admin","superadmin"]},"me":{"type":"boolean"}},"required":["jid","phone","name","role","me"],"additionalProperties":false}},"canManage":{"type":"boolean"}},"required":["participants","canManage"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/inbox.group_participants_update":{"post":{"operationId":"inbox.group_participants_update","tags":["inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/inbox.group_participants_update.md"},"x-mcp-tool":"inbox_group_participants_update","x-cli":"node cli/atomiks.mjs inbox.group_participants_update --json '{...}'","x-session-only":false,"summary":"Adicionar, remover, promover ou rebaixar participantes de um grupo","description":"Age no grupo da conversa pelo número por QR, que precisa ser administrador do grupo. `participants` = telefones com DDI (só dígitos) ou JIDs (`...@s.whatsapp.net`, `...@lid`), até 50. Devolve o resultado de cada um como o WhatsApp informa (`status` \"200\" = feito; 403/409 = sem permissão ou já está/não está no grupo).","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conversationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["add","remove","promote","demote"]},"participants":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":5,"maxLength":80}}},"required":["conversationId","action","participants"]},"example":{"conversationId":"00000000-0000-0000-0000-000000000000","action":"add","participants":["5511999990000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"status":{"type":"string"}},"required":["jid","status"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.indicators_get":{"post":{"operationId":"crm.indicators_get","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.indicators_get.md"},"x-mcp-tool":"crm_indicators_get","x-cli":"node cli/atomiks.mjs crm.indicators_get --json '{...}'","x-session-only":false,"summary":"Ver a configuração de Temperatura e Score","description":"Modelo de Temperatura em uso (pesos das dimensões R/F/P/D, faixas Frio/Morno/Quente, peso de cada canal, janela em dias, meia-vida de Recência e Frequência), catálogo de eventos com peso padrão e efetivo (`available: false` = evento que o Atomiks ainda não observa: nunca pontua), modelos prontos e o Score (ligado ou não, teto, cortes Médio/Alto e regras).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"temperature":{"type":"object","properties":{"modelId":{"type":"string"},"modelName":{"type":"string"},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"number"},"halflives":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"}},"required":["R","F"],"additionalProperties":false},"eventWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["modelId","modelName","dimensions","thresholds","channels","windowDays","halflives","eventWeights"],"additionalProperties":false},"catalog":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"baseWeight":{"type":"number"},"weight":{"type":"number"},"teamAction":{"type":"boolean"},"effectiveFrom":{"type":["string","null"]},"available":{"type":"boolean"}},"required":["eventName","label","dimension","channel","baseWeight","weight","teamAction","effectiveFrom","available"],"additionalProperties":false}},"activeModelId":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortName":{"type":"string"},"tagline":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"windowDays":{"type":"number"},"halflifeR":{"type":"number"},"halflifeF":{"type":"number"},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false}},"required":["id","name","shortName","tagline","description","icon","windowDays","halflifeR","halflifeF","thresholds","channels","dimensions"],"additionalProperties":false}},"customModels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"basedOn":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"],"additionalProperties":false},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name","basedOn","thresholds","channels","windowDays","halflives","id"],"additionalProperties":false}},"limits":{"type":"object","properties":{"windowOptions":{"type":"array","items":{"type":"number"}},"halflifeMin":{"type":"number"},"halflifeMax":{"type":"number"}},"required":["windowOptions","halflifeMin","halflifeMax"],"additionalProperties":false},"score":{"type":"object","properties":{"enabled":{"type":"boolean"},"maxScore":{"type":"number"},"thresholdMedium":{"type":"number"},"thresholdHigh":{"type":"number"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":300},"points":{"type":"integer","minimum":-1000,"maximum":1000},"enabled":{"type":"boolean"},"filters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}}},"required":["id","name","points","enabled","filters"],"additionalProperties":false}}},"required":["enabled","maxScore","thresholdMedium","thresholdHigh","rules"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["temperature","catalog","activeModelId","models","customModels","limits","score","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.indicators_update":{"post":{"operationId":"crm.indicators_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.indicators_update.md"},"x-mcp-tool":"crm_indicators_update","x-cli":"node cli/atomiks.mjs crm.indicators_update --json '{...}'","x-session-only":false,"summary":"Ajustar Temperatura e Score","description":"Admin. `temperature` substitui os ajustes sobre o modelo (`{}` restaura tudo ao padrão): `modelId` (modelo pronto base), `customModelId` (modelo próprio ativo, de `crm.temperature_model_create`; os blocos dele vão junto nos ajustes), `thresholds {morno, quente}` (Morno ao menos 5 abaixo de Quente), `channels` (0 a 100), `windowDays` (7, 14, 21, 30 ou 60), `halflives {R, F}` (1 a 30 dias) e `eventWeights` (−100 a 100 por evento do catálogo). `score` troca `maxScore`, `thresholdMedium`, `thresholdHigh` e `rules` (cada regra: `name`, `description`, `points` de −1000 a 1000, `enabled` e `filters`, o filtro de segmento de `contacts.list`; ao menos uma condição e sem filtrar pelo próprio Score). Ao salvar, a conta inteira é recalculada pelo worker em alguns minutos.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"temperature":{"type":"object","properties":{"modelId":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"customModelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"]},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"]},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"]},"eventWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-100,"maximum":100}}},"additionalProperties":false},"score":{"type":"object","properties":{"maxScore":{"default":100,"type":"integer","minimum":10,"maximum":1000},"thresholdMedium":{"default":30,"type":"integer","minimum":1,"maximum":999},"thresholdHigh":{"default":60,"type":"integer","minimum":2,"maximum":1000},"rules":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":300},"points":{"type":"integer","minimum":-1000,"maximum":1000},"enabled":{"type":"boolean"},"filters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["id","name","points","enabled","filters"]}}}}}},"example":{"temperature":{"thresholds":{"morno":30,"quente":60}}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"temperature":{"type":"object","properties":{"modelId":{"type":"string"},"modelName":{"type":"string"},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"number"},"halflives":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"}},"required":["R","F"],"additionalProperties":false},"eventWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["modelId","modelName","dimensions","thresholds","channels","windowDays","halflives","eventWeights"],"additionalProperties":false},"catalog":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"baseWeight":{"type":"number"},"weight":{"type":"number"},"teamAction":{"type":"boolean"},"effectiveFrom":{"type":["string","null"]},"available":{"type":"boolean"}},"required":["eventName","label","dimension","channel","baseWeight","weight","teamAction","effectiveFrom","available"],"additionalProperties":false}},"activeModelId":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortName":{"type":"string"},"tagline":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"windowDays":{"type":"number"},"halflifeR":{"type":"number"},"halflifeF":{"type":"number"},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false}},"required":["id","name","shortName","tagline","description","icon","windowDays","halflifeR","halflifeF","thresholds","channels","dimensions"],"additionalProperties":false}},"customModels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"basedOn":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"],"additionalProperties":false},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name","basedOn","thresholds","channels","windowDays","halflives","id"],"additionalProperties":false}},"limits":{"type":"object","properties":{"windowOptions":{"type":"array","items":{"type":"number"}},"halflifeMin":{"type":"number"},"halflifeMax":{"type":"number"}},"required":["windowOptions","halflifeMin","halflifeMax"],"additionalProperties":false},"score":{"type":"object","properties":{"enabled":{"type":"boolean"},"maxScore":{"type":"number"},"thresholdMedium":{"type":"number"},"thresholdHigh":{"type":"number"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":300},"points":{"type":"integer","minimum":-1000,"maximum":1000},"enabled":{"type":"boolean"},"filters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}}},"required":["id","name","points","enabled","filters"],"additionalProperties":false}}},"required":["enabled","maxScore","thresholdMedium","thresholdHigh","rules"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["temperature","catalog","activeModelId","models","customModels","limits","score","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.indicators_activate_score":{"post":{"operationId":"crm.indicators_activate_score","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.indicators_activate_score.md"},"x-mcp-tool":"crm_indicators_activate_score","x-cli":"node cli/atomiks.mjs crm.indicators_activate_score --json '{...}'","x-session-only":false,"summary":"Ligar ou desligar o Score","description":"Admin. O Score vem desligado; ligado, cada contato soma os pontos das regras que casam (de 0 ao teto). Desligar apaga o número dos contatos (\"—\"). A conta é recalculada pelo worker.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"default":true,"type":"boolean"}}},"example":{"enabled":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"temperature":{"type":"object","properties":{"modelId":{"type":"string"},"modelName":{"type":"string"},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"number"},"halflives":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"}},"required":["R","F"],"additionalProperties":false},"eventWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["modelId","modelName","dimensions","thresholds","channels","windowDays","halflives","eventWeights"],"additionalProperties":false},"catalog":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"baseWeight":{"type":"number"},"weight":{"type":"number"},"teamAction":{"type":"boolean"},"effectiveFrom":{"type":["string","null"]},"available":{"type":"boolean"}},"required":["eventName","label","dimension","channel","baseWeight","weight","teamAction","effectiveFrom","available"],"additionalProperties":false}},"activeModelId":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortName":{"type":"string"},"tagline":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"windowDays":{"type":"number"},"halflifeR":{"type":"number"},"halflifeF":{"type":"number"},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"number"},"msg":{"type":"number"},"page":{"type":"number"},"pay":{"type":"number"},"crm":{"type":"number"}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"dimensions":{"type":"object","properties":{"R":{"type":"number"},"F":{"type":"number"},"P":{"type":"number"},"D":{"type":"number"}},"required":["R","F","P","D"],"additionalProperties":false}},"required":["id","name","shortName","tagline","description","icon","windowDays","halflifeR","halflifeF","thresholds","channels","dimensions"],"additionalProperties":false}},"customModels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"basedOn":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"],"additionalProperties":false},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name","basedOn","thresholds","channels","windowDays","halflives","id"],"additionalProperties":false}},"limits":{"type":"object","properties":{"windowOptions":{"type":"array","items":{"type":"number"}},"halflifeMin":{"type":"number"},"halflifeMax":{"type":"number"}},"required":["windowOptions","halflifeMin","halflifeMax"],"additionalProperties":false},"score":{"type":"object","properties":{"enabled":{"type":"boolean"},"maxScore":{"type":"number"},"thresholdMedium":{"type":"number"},"thresholdHigh":{"type":"number"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":300},"points":{"type":"integer","minimum":-1000,"maximum":1000},"enabled":{"type":"boolean"},"filters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}}},"required":["id","name","points","enabled","filters"],"additionalProperties":false}}},"required":["enabled","maxScore","thresholdMedium","thresholdHigh","rules"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["temperature","catalog","activeModelId","models","customModels","limits","score","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.score_overview":{"post":{"operationId":"crm.score_overview","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.score_overview.md"},"x-mcp-tool":"crm_score_overview","x-cli":"node cli/atomiks.mjs crm.score_overview --json '{...}'","x-session-only":false,"summary":"Ver a distribuição do Score e o alcance de cada regra","description":"Números da tela Score: `distribution` (contatos na base, quantos ainda sem cálculo, média, histograma em 10 faixas de largura teto/10, e contatos em Baixo, Médio e Alto), `reach` (para cada regra, quantos contatos casam com o filtro dela, ligada ou não; `null` = filtro inválido) e `lastRecomputedAt` (último recálculo gravado na base). Conta só os contatos que o membro vê. Sem a migration 20261026000008 volta tudo zerado.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"distribution":{"type":"object","properties":{"totalContacts":{"type":"number"},"notScored":{"type":"number"},"average":{"type":["number","null"]},"histogram":{"type":"array","items":{"type":"number"}},"low":{"type":"number"},"medium":{"type":"number"},"high":{"type":"number"}},"required":["totalContacts","notScored","average","histogram","low","medium","high"],"additionalProperties":false},"reach":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["number","null"]}},"lastRecomputedAt":{"type":["string","null"]}},"required":["distribution","reach","lastRecomputedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.score_rule_preview":{"post":{"operationId":"crm.score_rule_preview","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.score_rule_preview.md"},"x-mcp-tool":"crm_score_rule_preview","x-cli":"node cli/atomiks.mjs crm.score_rule_preview --json '{...}'","x-session-only":false,"summary":"Prévia de uma regra de Score antes de salvar","description":"Admin. Para o filtro de segmento (`filters`, o mesmo de `contacts.list`) e os `points` da regra: quantos contatos ela alcança (`matchingContacts` de `totalContacts`), quantos mudam de faixa (`bandShift`, por faixa) e três exemplos de quem entra, com o Score de antes e de depois. Com `ruleId`, desconta o que a versão salva da regra já soma, para mostrar só o efeito da mudança. Não grava nada. Sem a migration 20261026000008 responde `migration_pendente`.","x-scope":"crm:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"points":{"type":"integer","minimum":-1000,"maximum":1000},"ruleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["filters"]},"example":{"filters":[{"field":"is_customer","operator":"equals","negation":false,"valueBool":true}],"points":20,"ruleId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totalContacts":{"type":"number"},"matchingContacts":{"type":"number"},"bandShift":{"type":"object","properties":{"low":{"type":"number"},"medium":{"type":"number"},"high":{"type":"number"}},"required":["low","medium","high"],"additionalProperties":false},"samples":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"fromScore":{"type":["number","null"]},"toScore":{"type":"number"}},"required":["id","name","email","fromScore","toScore"],"additionalProperties":false}}},"required":["totalContacts","matchingContacts","bandShift","samples"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.temperature_model_create":{"post":{"operationId":"crm.temperature_model_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.temperature_model_create.md"},"x-mcp-tool":"crm_temperature_model_create","x-cli":"node cli/atomiks.mjs crm.temperature_model_create --json '{...}'","x-session-only":false,"summary":"Salvar um modelo de Temperatura próprio","description":"Admin. Guarda como modelo próprio (até 10 por conta) os blocos ajustados sobre um modelo pronto: `basedOn`, `thresholds`, `channels`, `windowDays` e `halflives`. Não ativa o modelo: para usá-lo, `crm.indicators_update` com `temperature.customModelId` e os mesmos blocos. Depende de uma migration; sem ela responde migration_pendente.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"basedOn":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"]},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"]},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"]}},"required":["name","basedOn","thresholds","channels","windowDays","halflives"],"additionalProperties":false},"example":{"name":"Lançamento de infoproduto customizado","basedOn":"lancamento","thresholds":{"morno":30,"quente":60},"channels":{"email":25,"msg":70,"page":50,"pay":100,"crm":70},"windowDays":14,"halflives":{"R":5,"F":7}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"basedOn":{"type":"string","enum":["lancamento","perpetuo","highticket","afiliado","lowticket","ecommerce"]},"thresholds":{"type":"object","properties":{"morno":{"type":"integer","minimum":1,"maximum":95},"quente":{"type":"integer","minimum":6,"maximum":100}},"required":["morno","quente"],"additionalProperties":false},"channels":{"type":"object","properties":{"email":{"type":"integer","minimum":0,"maximum":100},"msg":{"type":"integer","minimum":0,"maximum":100},"page":{"type":"integer","minimum":0,"maximum":100},"pay":{"type":"integer","minimum":0,"maximum":100},"crm":{"type":"integer","minimum":0,"maximum":100}},"required":["email","msg","page","pay","crm"],"additionalProperties":false},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"halflives":{"type":"object","properties":{"R":{"type":"integer","minimum":1,"maximum":30},"F":{"type":"integer","minimum":1,"maximum":30}},"required":["R","F"],"additionalProperties":false},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name","basedOn","thresholds","channels","windowDays","halflives","id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.temperature_preview":{"post":{"operationId":"crm.temperature_preview","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.temperature_preview.md"},"x-mcp-tool":"crm_temperature_preview","x-cli":"node cli/atomiks.mjs crm.temperature_preview --json '{...}'","x-session-only":false,"summary":"Amostra de contatos para a prévia da Temperatura","description":"Até 3 contatos reais (de preferência com atividade), espalhados da temperatura mais alta à mais baixa, com os sinais dos últimos 60 dias (`activities`: evento do catálogo e data). A tela recalcula a nota deles ao vivo conforme o admin ajusta a configuração. Sem contatos com temperatura calculada, `candidates` vem vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"activities":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"createdAt":{"type":"string"}},"required":["eventName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","activities"],"additionalProperties":false}}},"required":["candidates"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.temperature_model_impact":{"post":{"operationId":"crm.temperature_model_impact","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.temperature_model_impact.md"},"x-mcp-tool":"crm_temperature_model_impact","x-cli":"node cli/atomiks.mjs crm.temperature_model_impact --json '{...}'","x-session-only":false,"summary":"Efeito de trocar o modelo de Temperatura na base","description":"Simula a troca para `modelId` (modelo pronto ou personalizado) sem salvar: recalcula contatos com temperatura (até 300) com a configuração de hoje e com os parâmetros do modelo escolhido (mantendo os pesos por evento salvos) e devolve quantos ficariam em Frio, Morno e Quente (`current` e `next`), três contatos de exemplo (`samples`) e, acima de 300 contatos ativos, `estimated: true` com os totais proporcionais. Contato sem temperatura conta como Frio nos dois lados.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"modelId":{"type":"string","minLength":1}},"required":["modelId"]},"example":{"modelId":"perpetuo"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totalContacts":{"type":"number"},"current":{"type":"object","properties":{"cold":{"type":"number"},"warm":{"type":"number"},"hot":{"type":"number"}},"required":["cold","warm","hot"],"additionalProperties":false},"next":{"type":"object","properties":{"cold":{"type":"number"},"warm":{"type":"number"},"hot":{"type":"number"}},"required":["cold","warm","hot"],"additionalProperties":false},"estimated":{"type":"boolean"},"sampledContacts":{"type":"number"},"activeContacts":{"type":"number"},"samples":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"currentScore":{"type":"number"},"nextScore":{"type":"number"},"nextBand":{"type":"string","enum":["cold","warm","hot"]}},"required":["id","name","email","currentScore","nextScore","nextBand"],"additionalProperties":false}}},"required":["totalContacts","current","next","estimated","sampledContacts","activeContacts","samples"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.temperature_explain":{"post":{"operationId":"contacts.temperature_explain","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.temperature_explain.md"},"x-mcp-tool":"contacts_temperature_explain","x-cli":"node cli/atomiks.mjs contacts.temperature_explain --json '{...}'","x-session-only":false,"summary":"Explicar a temperatura de um contato","description":"O porquê do número: `stored` é o último cálculo gravado (o que a lista mostra), `live` refaz a conta agora com os mesmos sinais (a temperatura esfria sozinha; a varredura diária regrava o número). `components` traz índice e contribuição de Recência, Frequência, Profundidade e Declaração (a soma das contribuições é o valor). `events` = o que pesou (agrupado por evento, com pontos e se define a Recência); `notDone` = sinais que o Atomiks observa e o contato ainda não fez na janela, com os pontos que dariam. `history` = valor por dia (60 dias) e as mudanças.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string"},"isCustomer":{"type":"boolean"},"stored":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"band":{"type":"string","enum":["cold","warm","hot"]},"trend7d":{"type":["number","null"]},"computedAt":{"type":["string","null"]},"components":{"anyOf":[{"type":"object","properties":{"R":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"F":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"P":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"D":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false}},"required":["R","F","P","D"],"additionalProperties":false},{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"count":{"type":"number"},"weightedPoints":{"type":"number"},"latestAt":{"type":"string"},"drivesRecency":{"type":"boolean"},"teamAction":{"type":"boolean"}},"required":["eventName","label","dimension","channel","count","weightedPoints","latestAt","drivesRecency","teamAction"],"additionalProperties":false}},"eventsTotal":{"type":"number"},"notDone":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"potentialPoints":{"type":"number"}},"required":["eventName","label","dimension","channel","potentialPoints"],"additionalProperties":false}}},"required":["value","band","trend7d","computedAt","components","events","eventsTotal","notDone"],"additionalProperties":false},{"type":"null"}]},"live":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"band":{"type":"string","enum":["cold","warm","hot"]},"components":{"type":"object","properties":{"R":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"F":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"P":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false},"D":{"type":"object","properties":{"index":{"type":"number"},"contribution":{"type":"number"}},"required":["index","contribution"],"additionalProperties":false}},"required":["R","F","P","D"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"count":{"type":"number"},"weightedPoints":{"type":"number"},"latestAt":{"type":"string"},"drivesRecency":{"type":"boolean"},"teamAction":{"type":"boolean"}},"required":["eventName","label","dimension","channel","count","weightedPoints","latestAt","drivesRecency","teamAction"],"additionalProperties":false}},"eventsTotal":{"type":"number"},"notDone":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"dimension":{"type":"string","enum":["R","F","P","D"]},"channel":{"type":"string","enum":["email","msg","page","pay","crm"]},"potentialPoints":{"type":"number"}},"required":["eventName","label","dimension","channel","potentialPoints"],"additionalProperties":false}}},"required":["value","band","components","events","eventsTotal","notDone"],"additionalProperties":false},{"type":"null"}]},"model":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"windowDays":{"type":"number"},"thresholds":{"type":"object","properties":{"morno":{"type":"number"},"quente":{"type":"number"}},"required":["morno","quente"],"additionalProperties":false}},"required":["id","name","windowDays","thresholds"],"additionalProperties":false},"history":{"type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"value":{"type":"number"}},"required":["day","value"],"additionalProperties":false}},"changes":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"from":{"type":"number"},"to":{"type":"number"},"delta":{"type":"number"}},"required":["day","from","to","delta"],"additionalProperties":false}},"changesTotal":{"type":"number"}},"required":["points","changes","changesTotal"],"additionalProperties":false}},"required":["contactId","isCustomer","stored","live","model","history"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.xray":{"post":{"operationId":"contacts.xray","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.xray.md"},"x-mcp-tool":"contacts_xray","x-cli":"node cli/atomiks.mjs contacts.xray --json '{...}'","x-session-only":false,"summary":"Raio-X do contato","description":"Tudo o que o Raio-X mostra numa chamada: cabeçalho (desde quando, de onde veio, tags, cliente, oportunidades abertas), temperatura e Score gravados, intenção (sinais de compra dos últimos 30 dias, pelo catálogo da temperatura), compras (quantidade, produtos distintos, ticket médio, LTV e valor em oportunidades abertas, em centavos), comunicação por canal (última interação, quem falou por último e consentimento: `can_receive` sem registro de opt-out, `subscribed` com opt-in, `unsubscribed` com opt-out; null = sem endereço no canal) e atividade dos últimos 14 dias. `contact` traz `code` (número sequencial), `city` e `state` do endereço. `purchases.products` = produtos distintos; `purchases.externalByCurrency` = vendas de plataformas integradas por moeda (aprovadas e renovações; `ltvCents` desconta reembolso e chargeback), vazio sem integração. `summary` traz o resumo da Atom guardado (`text` e `generatedAt`; `available: false` e `text: null` enquanto não há); quem gera e refaz é `contacts.xray_summary`.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contact":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":["number","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"since":{"type":"string"},"isCustomer":{"type":"boolean"},"openOpportunities":{"type":"number"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"tagsTotal":{"type":"number"}},"required":["id","code","name","phone","email","city","state","avatarUrl","since","isCustomer","openOpportunities","tags","tagsTotal"],"additionalProperties":false},"origin":{"type":"object","properties":{"kind":{"type":["string","null"]},"detail":{"type":["string","null"]},"adId":{"type":["string","null"]},"adName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"headline":{"type":["string","null"]}},"required":["kind","detail","adId","adName","campaignName","headline"],"additionalProperties":false},"temperature":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"band":{"type":"string","enum":["cold","warm","hot"]},"trend7d":{"type":["number","null"]},"computedAt":{"type":["string","null"]}},"required":["value","band","trend7d","computedAt"],"additionalProperties":false},{"type":"null"}]},"score":{"type":"object","properties":{"enabled":{"type":"boolean"},"value":{"type":["number","null"]},"tier":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}]}},"required":["enabled","value","tier"],"additionalProperties":false},"summary":{"type":"object","properties":{"available":{"type":"boolean"},"text":{"type":["string","null"]},"generatedAt":{"type":["string","null"]},"reason":{"type":"string"}},"required":["available","text","generatedAt","reason"],"additionalProperties":false},"intent":{"type":"object","properties":{"level":{"type":"string","enum":["high","medium","low","none"]},"windowDays":{"type":"number"},"signals":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"lastAt":{"type":"string"}},"required":["eventName","label","count","lastAt"],"additionalProperties":false}}},"required":["level","windowDays","signals"],"additionalProperties":false},"purchases":{"type":"object","properties":{"count":{"type":"number"},"products":{"type":"number"},"externalByCurrency":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"count":{"type":"number"},"totalCents":{"type":"number"},"avgCents":{"type":"number"},"ltvCents":{"type":"number"}},"required":["currency","count","totalCents","avgCents","ltvCents"],"additionalProperties":false}},"avgTicketCents":{"type":"number"},"ltvCents":{"type":"number"},"openCents":{"type":"number"},"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productName":{"type":["string","null"]},"valueCents":{"type":"number"},"soldAt":{"type":"string"},"source":{"type":"string"}},"required":["id","productName","valueCents","soldAt","source"],"additionalProperties":false}}},"required":["count","products","externalByCurrency","avgTicketCents","ltvCents","openCents","orders"],"additionalProperties":false},"communication":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","email","instagram","telegram","voice"]},"lastInteractionAt":{"type":["string","null"]},"lastInboundAt":{"type":["string","null"]},"lastDirection":{"anyOf":[{"type":"string","enum":["inbound","outbound"]},{"type":"null"}]},"consent":{"anyOf":[{"type":"string","enum":["can_receive","subscribed","unsubscribed"]},{"type":"null"}]}},"required":["channel","lastInteractionAt","lastInboundAt","lastDirection","consent"],"additionalProperties":false}},"activity":{"type":"object","properties":{"windowDays":{"type":"number"},"total":{"type":"number"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"latestAt":{"type":"string"}},"required":["name","label","count","latestAt"],"additionalProperties":false}}},"required":["windowDays","total","days","items"],"additionalProperties":false},"updatedAt":{"type":"string"}},"required":["contact","origin","temperature","score","summary","intent","purchases","communication","activity","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.xray_summary":{"post":{"operationId":"contacts.xray_summary","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.xray_summary.md"},"x-mcp-tool":"contacts_xray_summary","x-cli":"node cli/atomiks.mjs contacts.xray_summary --json '{...}'","x-session-only":false,"summary":"Resumo da Atom no Raio-X do contato","description":"Resumo em 2 ou 3 frases do contato, escrito pela Atom (claude-haiku-5-5) só com os fatos do Raio-X. Devolve o resumo guardado (`cached: true`) enquanto ele tiver menos de 24 h; gera de novo (`cached: false`) quando não há resumo, depois de 24 h ou com `force: true` (o \"refazer\" da tela). `locale` é o idioma da tela (padrão pt-BR). Sem a variável ANTHROPIC_API_KEY no servidor responde `credencial_ausente` (503). O contato precisa estar visível para quem chama; o texto fica em `contacts.xray` > `summary`.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"force":{"type":"boolean"},"locale":{"type":"string","maxLength":20}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","force":false,"locale":"pt-BR"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string"},"generatedAt":{"type":"string"},"cached":{"type":"boolean"}},"required":["text","generatedAt","cached"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me.view_prefs_get":{"post":{"operationId":"me.view_prefs_get","tags":["me"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/me.view_prefs_get.md"},"x-mcp-tool":"me_view_prefs_get","x-cli":"node cli/atomiks.mjs me.view_prefs_get --json '{...}'","x-session-only":false,"summary":"Ver minhas preferências de tela","description":"Preferências do próprio usuário para uma tela, na conta atual. `contacts`: `columns` (ids visíveis na ordem; `null` = padrão) e `perPage` (20, 50 ou 100). Sem registro, devolve o padrão.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"view":{"type":"string","enum":["contacts"]}},"required":["view"]},"example":{"view":"contacts"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"view":{"type":"string","const":"contacts"},"prefs":{"type":"object","properties":{"columns":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string"}},{"type":"null"}]},"perPage":{"anyOf":[{"type":"number","const":20},{"type":"number","const":50},{"type":"number","const":100}]}},"required":["columns"],"additionalProperties":false}},"required":["view","prefs"],"additionalProperties":false}]}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me.view_prefs_set":{"post":{"operationId":"me.view_prefs_set","tags":["me"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/me.view_prefs_set.md"},"x-mcp-tool":"me_view_prefs_set","x-cli":"node cli/atomiks.mjs me.view_prefs_set --json '{...}'","x-session-only":false,"summary":"Salvar minhas preferências de tela","description":"Substitui as preferências do próprio usuário para a tela, na conta atual. Restaurar o padrão das colunas = `columns: null`. `contacts.columns` aceita os ids do catálogo e `cf:{customFieldId}` (até 20), sem repetir.","x-scope":"contacts:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"view":{"type":"string","const":"contacts"},"prefs":{"type":"object","properties":{"columns":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string"}},{"type":"null"}]},"perPage":{"anyOf":[{"type":"number","const":20},{"type":"number","const":50},{"type":"number","const":100}]}},"required":["columns"],"additionalProperties":false}},"required":["view","prefs"]}]},"example":{"view":"contacts","prefs":{"columns":["contact","tags","email","phone"],"perPage":50}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"view":{"type":"string","const":"contacts"},"prefs":{"type":"object","properties":{"columns":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string"}},{"type":"null"}]},"perPage":{"anyOf":[{"type":"number","const":20},{"type":"number","const":50},{"type":"number","const":100}]}},"required":["columns"],"additionalProperties":false}},"required":["view","prefs"],"additionalProperties":false}]}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.segments_list":{"post":{"operationId":"crm.segments_list","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.segments_list.md"},"x-mcp-tool":"crm_segments_list","x-cli":"node cli/atomiks.mjs crm.segments_list --json '{...}'","x-session-only":false,"summary":"Listar segmentos da conta","description":"Segmentos salvos da conta em ordem alfabética, cada um com o filtro (`filter`, mesmo formato do construtor). `q` filtra pelo nome (\"Buscar segmento...\").","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","emoji","filter","createdBy","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.segment_create":{"post":{"operationId":"crm.segment_create","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.segment_create.md"},"x-mcp-tool":"crm_segment_create","x-cli":"node cli/atomiks.mjs crm.segment_create --json '{...}'","x-session-only":false,"summary":"Criar segmento","description":"Salva o filtro atual como segmento da conta. Nome único na conta sem diferenciar maiúsculas; repetido dá `invalid_input`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"emoji":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["name","filter"]},"example":{"name":"Clientes VIP","filter":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","emoji","filter","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.segment_update":{"post":{"operationId":"crm.segment_update","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.segment_update.md"},"x-mcp-tool":"crm_segment_update","x-cli":"node cli/atomiks.mjs crm.segment_update --json '{...}'","x-session-only":false,"summary":"Editar segmento","description":"Renomeia, troca o emoji e/ou substitui o filtro. Campos omitidos não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"emoji":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Clientes VIP 2026"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","emoji","filter","createdBy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.segment_delete":{"post":{"operationId":"crm.segment_delete","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.segment_delete.md"},"x-mcp-tool":"crm_segment_delete","x-cli":"node cli/atomiks.mjs crm.segment_delete --json '{...}'","x-session-only":false,"summary":"Apagar segmento","description":"Apaga o segmento. Os contatos não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_tags":{"post":{"operationId":"contacts.bulk_tags","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_tags.md"},"x-mcp-tool":"contacts_bulk_tags","x-cli":"node cli/atomiks.mjs contacts.bulk_tags --json '{...}'","x-session-only":false,"summary":"Aplicar ou tirar tags de vários contatos","description":"`target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`). Só entram contatos que o membro vê e fora da lixeira; acima de 10 000 dá `invalid_input` (refine o filtro). `add` e `remove` são ids de tag (até 100 cada; os dois juntos valem). Idempotente. Não dispara flows de \"tag adicionada/removida\"; temperatura e score dos contatos são recalculados. `count` = contatos do alvo.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]},"add":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"remove":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["target"]},"example":{"target":{"ids":["00000000-0000-0000-0000-000000000000"]},"add":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_lists":{"post":{"operationId":"contacts.bulk_lists","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_lists.md"},"x-mcp-tool":"contacts_bulk_lists","x-cli":"node cli/atomiks.mjs contacts.bulk_lists --json '{...}'","x-session-only":false,"summary":"Pôr ou tirar vários contatos de listas","description":"`target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`). Só entram contatos que o membro vê e fora da lixeira; acima de 10 000 dá `invalid_input` (refine o filtro). `add` e `remove` são ids de lista (até 100 cada). Idempotente. `count` = contatos do alvo.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]},"add":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"remove":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["target"]},"example":{"target":{"filter":[],"q":"maria"},"add":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_add_to_pipeline":{"post":{"operationId":"contacts.bulk_add_to_pipeline","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_add_to_pipeline.md"},"x-mcp-tool":"contacts_bulk_add_to_pipeline","x-cli":"node cli/atomiks.mjs contacts.bulk_add_to_pipeline --json '{...}'","x-session-only":false,"summary":"Adicionar vários contatos a uma pipeline","description":"`target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`). Só entram contatos que o membro vê e fora da lixeira; acima de 10 000 dá `invalid_input` (refine o filtro). Cria um card por contato na etapa `stageId` da pipeline `pipelineId` (título = nome, senão telefone; responsável = quem chamou). Quem já tem oportunidade aberta nesta pipeline fica onde está e conta em `skipped`. Não dispara flows de \"entrou na etapa\"; temperatura e score são recalculados.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["target","pipelineId","stageId"]},"example":{"target":{"ids":["00000000-0000-0000-0000-000000000000"]},"pipelineId":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"created":{"type":"number"},"skipped":{"type":"number"}},"required":["created","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_delete":{"post":{"operationId":"contacts.bulk_delete","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_delete.md"},"x-mcp-tool":"contacts_bulk_delete","x-cli":"node cli/atomiks.mjs contacts.bulk_delete --json '{...}'","x-session-only":false,"summary":"Mandar contatos para a lixeira","description":"Só administrador. `target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`). Só entram contatos que o membro vê e fora da lixeira; acima de 10 000 dá `invalid_input` (refine o filtro). Os contatos somem da lista, das buscas e das estatísticas e ficam 30 dias na lixeira (`contacts.trash_restore` traz de volta); depois disso são apagados de vez, com conversas, mensagens, vendas e oportunidades. `count` = contatos que foram para a lixeira.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]}},"required":["target"]},"example":{"target":{"ids":["00000000-0000-0000-0000-000000000000"]}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.trash_restore":{"post":{"operationId":"contacts.trash_restore","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.trash_restore.md"},"x-mcp-tool":"contacts_trash_restore","x-cli":"node cli/atomiks.mjs contacts.trash_restore --json '{...}'","x-session-only":false,"summary":"Tirar contatos da lixeira","description":"Só administrador. Devolve à lista os contatos da lixeira (ids que não estão na lixeira são ignorados). `count` = contatos restaurados.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"]},"example":{"ids":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_send":{"post":{"operationId":"contacts.bulk_send","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_send.md"},"x-mcp-tool":"contacts_bulk_send","x-cli":"node cli/atomiks.mjs contacts.bulk_send --json '{...}'","x-session-only":false,"summary":"Enviar mensagem em massa","description":"`target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`). Só entram contatos que o membro vê e fora da lixeira; acima de 10 000 dá `invalid_input` (refine o filtro). Enfileira um envio pelo número `channelId` (WhatsApp; precisa de acesso ao número). API oficial: só modelo aprovado (`templateId` + `params` com as variáveis `1`, `2`… e `header`). Número por QR code: só `text`. O worker envia em ritmo controlado; quem tem opt-out de WhatsApp, contato sem telefone ou excluído é pulado. Acompanhe com `contacts.bulk_send_get`.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"params":{"type":"object","propertyNames":{"type":"string","maxLength":20},"additionalProperties":{"type":"string","maxLength":1000}},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["target","channelId"]},"example":{"target":{"ids":["00000000-0000-0000-0000-000000000000"]},"channelId":"00000000-0000-0000-0000-000000000000","templateId":"00000000-0000-0000-0000-000000000000","params":{"1":"Maria"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"count":{"type":"number"}},"required":["jobId","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_send_get":{"post":{"operationId":"contacts.bulk_send_get","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_send_get.md"},"x-mcp-tool":"contacts_bulk_send_get","x-cli":"node cli/atomiks.mjs contacts.bulk_send_get --json '{...}'","x-session-only":false,"summary":"Andamento de um envio em massa","description":"Quem criou o envio ou um administrador. `status`: `queued` (na fila), `running`, `done` ou `failed`. Contagens por item; `failures` traz até 100 contatos com falha ou pulados e o motivo.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["jobId"]},"example":{"jobId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["queued","running","done","failed"]},"total":{"type":"number"},"sent":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"},"error":{"type":["string","null"]},"failures":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":"string"},"status":{"type":"string","enum":["failed","skipped"]},"error":{"type":["string","null"]}},"required":["contactId","status","error"],"additionalProperties":false}}},"required":["status","total","sent","failed","skipped","error","failures"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.stats":{"post":{"operationId":"contacts.stats","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.stats.md"},"x-mcp-tool":"contacts_stats","x-cli":"node cli/atomiks.mjs contacts.stats --json '{...}'","x-session-only":false,"summary":"Saúde da base, canais de entrada e vendas dos contatos","description":"Números do recorte (`filter` e `q` iguais aos de `contacts.list`), só com os contatos que o membro vê e fora da lixeira. Percentuais de 0 a 100.\n\n`temperature`: média (null sem cálculo), faixa da média pelos cortes da conta, `computed` (contatos com temperatura) e contagem por faixa (`pct` sobre os calculados). `score`: idem por tier, com `enabled` da conta.\n\n`channels`: contatos por origem (`key` = `origin_kind`: `ad`, `organic`, `manual`, `import`, `integration`, `instagram`, `form`, `api`; `pct` sobre o total), do maior para o menor.\n\n`origins`: contatos por origem · sub-origem (`kind` = `origin_kind`; `detail` = campanha do anúncio para `ad`, senão `origin_detail`; null = sem sub-origem), `pct` sobre o total, do maior para o menor. `visits.identified`: contatos com visita identificada (sempre 0: o Atomiks não rastreia páginas).\n\n`sales` (vendas não canceladas dos contatos do recorte): `totalSales` (compras), `avgPurchasesPerContact` (compras ÷ contatos), `ltvCents` (receita ÷ contatos) e `ticketCents` (receita ÷ compras), em centavos.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100}}},"example":{"filter":[{"field":"tag","operator":"in","negation":false,"valueUuid":"00000000-0000-0000-0000-000000000000"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"total":{"type":"number"},"temperature":{"type":"object","properties":{"avg":{"type":["number","null"]},"band":{"anyOf":[{"type":"string","enum":["cold","warm","hot"]},{"type":"null"}]},"computed":{"type":"number"},"bands":{"type":"object","properties":{"hot":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false},"warm":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false},"cold":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false}},"required":["hot","warm","cold"],"additionalProperties":false}},"required":["avg","band","computed","bands"],"additionalProperties":false},"score":{"type":"object","properties":{"enabled":{"type":"boolean"},"avg":{"type":["number","null"]},"tiers":{"type":"object","properties":{"high":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false},"medium":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false},"low":{"type":"object","properties":{"count":{"type":"number"},"pct":{"type":"number"}},"required":["count","pct"],"additionalProperties":false}},"required":["high","medium","low"],"additionalProperties":false}},"required":["enabled","avg","tiers"],"additionalProperties":false},"channels":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"pct":{"type":"number"}},"required":["key","label","count","pct"],"additionalProperties":false}},"origins":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"detail":{"type":["string","null"]},"label":{"type":"string"},"count":{"type":"number"},"pct":{"type":"number"}},"required":["kind","detail","label","count","pct"],"additionalProperties":false}},"visits":{"type":"object","properties":{"identified":{"type":"number"}},"required":["identified"],"additionalProperties":false},"sales":{"type":"object","properties":{"totalSales":{"type":"number"},"avgPurchasesPerContact":{"type":"number"},"ltvCents":{"type":"number"},"ticketCents":{"type":"number"}},"required":["totalSales","avgPurchasesPerContact","ltvCents","ticketCents"],"additionalProperties":false}},"required":["total","temperature","score","channels","origins","visits","sales"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.growth":{"post":{"operationId":"contacts.growth","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.growth.md"},"x-mcp-tool":"contacts_growth","x-cli":"node cli/atomiks.mjs contacts.growth --json '{...}'","x-session-only":false,"summary":"Novos contatos por dia ou semana","description":"Contatos criados (`first_seen_at`) por dia ou semana (começa na segunda) entre `from` e `to` (AAAA-MM-DD, inclusivos, no fuso da conta; até 1200 dias), com zero nos períodos sem contato. `cumulative` é a soma dentro do período. Mesmo recorte e mesma visibilidade de `contacts.stats`.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bucket":{"type":"string","enum":["day","week"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100}},"required":["from","to","bucket"]},"example":{"from":"2026-10-11","to":"2026-10-25","bucket":"day"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"points":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"new":{"type":"number"},"cumulative":{"type":"number"}},"required":["date","new","cumulative"],"additionalProperties":false}}},"required":["points"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.import_create":{"post":{"operationId":"contacts.import_create","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.import_create.md"},"x-mcp-tool":"contacts_import_create","x-cli":"node cli/atomiks.mjs contacts.import_create --json '{...}'","x-session-only":false,"summary":"Importar contatos de um arquivo","description":"Enfileira a importação; o processamento roda em segundo plano, em lotes de 500. Acompanhe por `contacts.import_get`.\n\nEntrada: `fileName`, `header` (cabeçalho do arquivo), as linhas e `mapping`. Linhas: `rows` (já lidas no navegador, até 50 000, cada uma na ordem do cabeçalho) ou `fileId` (o CSV cru enviado com `contacts.import_upload_url`, até 100 MB e 500 000 linhas; o servidor lê o arquivo, confere que o cabeçalho é igual a `header` e conta as linhas, e até lá `total` fica 0). `mapping`: coluna do arquivo -> `ignore`, uma chave do contato (`contact`/`name`, `email`, `phone`/`whatsapp` (com DDI; 10 ou 11 dígitos ganham 55), `secondaryEmail`, `document`, `city`, `state`, `profession`, `language`, `gender` (masculino/feminino/outro), `birthday` (DD/MM/AAAA ou AAAA-MM-DD), `instagram`, `linkedin`, `telegram`, `lgpd` (sim/não)), `cf:<id do campo personalizado>` ou `consent:<canal>` (sim/não = opt-in/opt-out; canais `whatsapp`, `email`, `sms`, `instagram`, `telegram`, `voice`). E-mail ou telefone mapeado é obrigatório; um campo só pode receber uma coluna.\n\nIdentidade: telefone, senão e-mail. Contato que já existe só tem os campos vazios preenchidos (mescla); opt-out importado sempre vale. Contatos novos ficam com origem `import` (detalhe = nome do arquivo) e visíveis para quem importou. `tagIds` e `listId` valem para todas as linhas importadas. Eventos de automação (contato criado, tag, campo) não disparam na importação.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"header":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","maxLength":200}},"rows":{"minItems":1,"maxItems":50000,"type":"array","items":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":2000}}},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mapping":{"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"type":"string","maxLength":60}},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"listId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["fileName","header","mapping"]},"example":{"fileName":"clientes.csv","header":["Nome","Celular"],"rows":[["Maria","11912345678"]],"mapping":{"Nome":"name","Celular":"phone"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"importId":{"type":"string"}},"required":["importId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.import_upload_url":{"post":{"operationId":"contacts.import_upload_url","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.import_upload_url.md"},"x-mcp-tool":"contacts_import_upload_url","x-cli":"node cli/atomiks.mjs contacts.import_upload_url --json '{...}'","x-session-only":false,"summary":"Pedir URL para enviar um arquivo de importação","description":"Para arquivos grandes (até 100 MB e 500 000 linhas). Devolve `fileId` e uma URL assinada (vale 2 horas): envie o CSV cru com `PUT` em `signedUrl` (corpo = o arquivo, `Content-Type: text/csv`). Depois chame `contacts.import_create` com `fileId` no lugar de `rows`. Só quem pediu a URL importa o arquivo. `fileName` termina em .csv, .tsv ou .txt.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":104857600}},"required":["fileName","size"]},"example":{"fileName":"clientes.csv","size":1048576}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fileId":{"type":"string"},"signedUrl":{"type":"string"},"token":{"type":"string"},"path":{"type":"string"}},"required":["fileId","signedUrl","token","path"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.import_get":{"post":{"operationId":"contacts.import_get","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.import_get.md"},"x-mcp-tool":"contacts_import_get","x-cli":"node cli/atomiks.mjs contacts.import_get --json '{...}'","x-session-only":false,"summary":"Ver o andamento de uma importação","description":"Status (`queued`, `running`, `done`, `failed`), linhas totais e processadas, contatos criados, atualizados e com falha, e até 100 falhas por linha (`row` = linha do arquivo, contando o cabeçalho como 1). Quem importou vê a sua; admin vê todas da conta.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"total":{"type":"number"},"processed":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"failed":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"],"additionalProperties":false}},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","fileName","status","total","processed","created","updated","failed","errors","error","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.imports_list":{"post":{"operationId":"contacts.imports_list","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.imports_list.md"},"x-mcp-tool":"contacts_imports_list","x-cli":"node cli/atomiks.mjs contacts.imports_list --json '{...}'","x-session-only":false,"summary":"Listar importações de contatos","description":"As 50 importações mais recentes que o membro pode ver (as suas; admin vê as da conta), da mais nova para a mais antiga.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"total":{"type":"number"},"processed":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"failed":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"],"additionalProperties":false}},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","fileName","status","total","processed","created","updated","failed","errors","error","createdAt","finishedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.export_create":{"post":{"operationId":"contacts.export_create","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.export_create.md"},"x-mcp-tool":"contacts_export_create","x-cli":"node cli/atomiks.mjs contacts.export_create --json '{...}'","x-session-only":false,"summary":"Exportar contatos em CSV","description":"Enfileira um CSV (UTF-8 com BOM, vírgula) com tudo que casa com `filter`/`q` (mesmo formato de `contacts.list`), nas colunas pedidas e na ordem dada. Até 100 000 contatos. Roda em segundo plano com as permissões de quem pediu: só sai o que a pessoa vê na lista. Acompanhe por `contacts.export_get`.\n\nColunas: ids de coluna da lista de contatos (`me.view_prefs_get`), `cf:<id>` e as só da exportação: `id`, `subOrigin` (anúncio/detalhe da origem), `createdAt` (DD/MM/AAAA HH:mm, Brasília) e, das vendas não canceladas, `purchasesCount`, `productsCount`, `lifetimeValue`, `ticketAverage`, `lastBuyPrice`, `lastBuyDate` (DD/MM/AAAA), `purchasedOfferNames` (produtos separados por `; `). Valores em reais como número puro com ponto (1234.50).\n\nCabeçalhos em snake_case, como no original: `nome`, `email`, `telefone`, `documento`, `tags` (separadas por `; `), `origem`, `sub_origem`, `status_email`, `cidade`, `estado`, `endereco`, `criado_em`, `ultimo_valor`, `qtd_compras`, `qtd_produtos`, `ltv`, `ticket_medio`, `ultima_compra`, `ofertas_compradas`, `id`; campo personalizado = rótulo em minúsculas com `_` no lugar dos espaços.\n\n`notifyEmail` (opcional): ao terminar, manda para esse endereço um e-mail com o link do arquivo, válido pelas 24 horas em que ele fica guardado.","x-scope":"contacts:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"columns":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"string"}},"notifyEmail":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["columns"]},"example":{"columns":["contact","email","phone","tags","origin"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"exportId":{"type":"string"},"count":{"type":"number"}},"required":["exportId","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.export_get":{"post":{"operationId":"contacts.export_get","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.export_get.md"},"x-mcp-tool":"contacts_export_get","x-cli":"node cli/atomiks.mjs contacts.export_get --json '{...}'","x-session-only":false,"summary":"Ver uma exportação e baixar o CSV","description":"Status (`queued`, `running`, `done`, `failed`), contatos no arquivo e, quando pronta, `url` assinada para baixar (vale 5 minutos; chame de novo para outra). O arquivo fica guardado por 24 horas; depois `url` volta `null` com `expired: true`. Quem pediu vê a sua; admin vê todas da conta.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"url":{"type":["string","null"]},"count":{"type":"number"},"processed":{"type":"number"},"expired":{"type":"boolean"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","status","url","count","processed","expired","error","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.bulk_enroll_flow":{"post":{"operationId":"contacts.bulk_enroll_flow","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.bulk_enroll_flow.md"},"x-mcp-tool":"contacts_bulk_enroll_flow","x-cli":"node cli/atomiks.mjs contacts.bulk_enroll_flow --json '{...}'","x-session-only":false,"summary":"Colocar vários contatos num flow","description":"`target` é `{ids}` (contatos escolhidos) ou `{filter, q?, excludeIds?}` (\"todos os que casam\", mesmo filtro e busca de `contacts.list`); só entram contatos que o membro vê, até 10 000. `flowId` é um flow ativo (publicado e ligado; veja `flows.list` com `status: \"active\"`). Cada contato começa uma execução da versão publicada, como em `flows.test_run`, ignorando os gatilhos de início; o worker roda as execuções em segundo plano. Quem já está no flow fica onde está e conta em `skipped`.","x-scope":"automations:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"],"additionalProperties":false},{"type":"object","properties":{"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"q":{"type":"string","maxLength":100},"excludeIds":{"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["filter"],"additionalProperties":false}]},"flowId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["target","flowId"]},"example":{"target":{"ids":["00000000-0000-0000-0000-000000000000"]},"flowId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"},"skipped":{"type":"number"}},"required":["count","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.participations":{"post":{"operationId":"contacts.participations","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.participations.md"},"x-mcp-tool":"contacts_participations","x-cli":"node cli/atomiks.mjs contacts.participations --json '{...}'","x-session-only":false,"summary":"Participações do contato","description":"Bloco Participações: envios em massa que o contato recebeu (`broadcasts`, nome = modelo ou início do texto), execuções de automação (`flows`), pipelines em que tem oportunidade (`pipelines`, uma linha por pipeline com a oportunidade mais recente; `value` em centavos) e listas manuais (`lists`). `count` é o total; `items` traz até 50, mais recentes primeiro.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"broadcasts":{"type":"object","properties":{"count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sentAt":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","name","sentAt","status"],"additionalProperties":false}}},"required":["count","items"],"additionalProperties":false},"flows":{"type":"object","properties":{"count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"flowId":{"type":"string"},"flowName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","failed","cancelled","suppressed"]},"startedAt":{"type":"string"}},"required":["runId","flowId","flowName","status","startedAt"],"additionalProperties":false}}},"required":["count","items"],"additionalProperties":false},"pipelines":{"type":"object","properties":{"count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageName":{"type":"string"},"status":{"type":"string"},"value":{"type":["number","null"]}},"required":["pipelineId","pipelineName","stageName","status","value"],"additionalProperties":false}}},"required":["count","items"],"additionalProperties":false},"lists":{"type":"object","properties":{"count":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["count","items"],"additionalProperties":false}},"required":["broadcasts","flows","pipelines","lists"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.flows":{"post":{"operationId":"contacts.flows","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.flows.md"},"x-mcp-tool":"contacts_flows","x-cli":"node cli/atomiks.mjs contacts.flows --json '{...}'","x-session-only":false,"summary":"Automações do contato","description":"Execuções de automação (flows) deste contato, mais recentes primeiro (até 200). `status`: active (rodando), waiting (esperando resposta ou prazo), completed, failed, cancelled (cancelada ou expirada). `lastStepAt` = último passo executado; `error` = último erro da execução.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"flowId":{"type":"string"},"flowName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","failed","cancelled","suppressed"]},"startedAt":{"type":"string"},"lastStepAt":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["runId","flowId","flowName","status","startedAt","lastStepAt","error"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.outbound_messages":{"post":{"operationId":"contacts.outbound_messages","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.outbound_messages.md"},"x-mcp-tool":"contacts_outbound_messages","x-cli":"node cli/atomiks.mjs contacts.outbound_messages --json '{...}'","x-session-only":false,"summary":"Mensagens enviadas ao contato","description":"Aba Histórico de Conversas: mensagens que saíram para o contato em todas as conversas dele (mais recentes primeiro). `channel` filtra pelo tipo do canal. `source`: bulk (envio em massa), flow (automação), automation (automação do Instagram) ou manual (atendente, API ou celular). Paginação: `before` = `nextBefore` da resposta anterior.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channel":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},"before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"channel":{"type":"string","enum":["whatsapp_cloud","whatsapp_web","instagram"]},"kind":{"type":"string"},"preview":{"type":["string","null"]},"sentAt":{"type":"string"},"status":{"type":["string","null"]},"source":{"type":"string","enum":["manual","flow","bulk","automation"]}},"required":["id","conversationId","channel","kind","preview","sentAt","status","source"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audit.list":{"post":{"operationId":"audit.list","tags":["audit"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/audit.list.md"},"x-mcp-tool":"audit_list","x-cli":"node cli/atomiks.mjs audit.list --json '{...}'","x-session-only":false,"summary":"Auditoria de um contato","description":"Só administradores. Alterações registradas na atividade da conta que citam o contato (alvo da ação, `contactId` da entrada ou dentro de `ids`/`contactIds`/`target.ids`), da mais recente para a mais antiga. Ação em massa por filtro (\"todos os que casam\") não cita os ids e não aparece aqui. `actor` null = sistema. Paginação: `before` = `nextBefore` (id da linha).","x-scope":"activity:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"resource":{"type":"string","const":"contact"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["resource","id"]},"example":{"resource":"contact","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"at":{"type":"string"},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"action":{"type":"string"},"summary":{"type":"string"}},"required":["id","at","actor","action","summary"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.avatar_set":{"post":{"operationId":"contacts.avatar_set","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.avatar_set.md"},"x-mcp-tool":"contacts_avatar_set","x-cli":"node cli/atomiks.mjs contacts.avatar_set --json '{...}'","x-session-only":false,"summary":"Trocar a foto do contato","description":"Põe como foto do contato uma imagem enviada antes por `POST /api/v1/uploads` (kind `image`; o próprio membro que enviou). Aceita JPEG, PNG ou WebP até 5 MB. A foto posta à mão não é trocada pela sincronização do WhatsApp ou do Instagram. Devolve a URL da foto.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId","uploadId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000","uploadId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"avatarUrl":{"type":"string"}},"required":["avatarUrl"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/contacts.merge_candidates":{"post":{"operationId":"contacts.merge_candidates","tags":["contacts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/contacts.merge_candidates.md"},"x-mcp-tool":"contacts_merge_candidates","x-cli":"node cli/atomiks.mjs contacts.merge_candidates --json '{...}'","x-session-only":false,"summary":"Possíveis duplicados do contato","description":"Outros contatos (não excluídos, visíveis ao membro) com o mesmo e-mail (sem caixa), telefone (ou o mesmo número como WhatsApp) ou Instagram (sem caixa). `matchedBy` diz o que coincidiu. Até 20.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["contactId"]},"example":{"contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"instagram":{"type":["string","null"]},"matchedBy":{"type":"array","items":{"type":"string","enum":["email","phone","instagram"]}}},"required":["id","name","phone","email","instagram","matchedBy"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications.list":{"post":{"operationId":"notifications.list","tags":["notifications"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/notifications.list.md"},"x-mcp-tool":"notifications_list","x-cli":"node cli/atomiks.mjs notifications.list --json '{...}'","x-session-only":false,"summary":"Listar minhas notificações","description":"Notificações do próprio usuário na conta atual, mais novas primeiro. `filter`: all, unread, activity (atribuições), system (números com falha ou desconectados), mention (menções a você). `limit` até 50; `nextCursor` continua a lista.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filter":{"default":"all","type":"string","enum":["all","unread","activity","system","mention"]},"limit":{"default":30,"type":"integer","minimum":1,"maximum":50},"cursor":{"type":"string","maxLength":200}}},"example":{"filter":"unread","limit":30}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"category":{"type":"string","enum":["activity","system","mention"]},"title":{"type":"string"},"body":{"type":["string","null"]},"actionUrl":{"type":["string","null"]},"readAt":{"type":["string","null"]},"createdAt":{"type":"string"},"tone":{"type":"string","enum":["danger","success","info"]},"channelType":{"anyOf":[{"type":"string","enum":["whatsapp","whatsapp_qr","instagram","telegram","webchat","email","sms","voice"]},{"type":"null"}]}},"required":["id","kind","category","title","body","actionUrl","readAt","createdAt","tone","channelType"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications.unread_count":{"post":{"operationId":"notifications.unread_count","tags":["notifications"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/notifications.unread_count.md"},"x-mcp-tool":"notifications_unread_count","x-cli":"node cli/atomiks.mjs notifications.unread_count --json '{...}'","x-session-only":false,"summary":"Total de notificações não lidas (badge do sino)","description":"Quantas notificações do próprio usuário na conta atual ainda não foram lidas.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications.mark_read":{"post":{"operationId":"notifications.mark_read","tags":["notifications"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/notifications.mark_read.md"},"x-mcp-tool":"notifications_mark_read","x-cli":"node cli/atomiks.mjs notifications.mark_read --json '{...}'","x-session-only":false,"summary":"Marcar notificações como lidas","description":"Marca como lidas as notificações do próprio usuário com esses ids (até 100). `all: true` marca todas da conta atual. Ids de outra pessoa são ignorados.","x-scope":null,"x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"type":"object","properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"]},{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"]}]},"example":{"all":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/onboarding.get":{"post":{"operationId":"onboarding.get","tags":["onboarding"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/onboarding.get.md"},"x-mcp-tool":"onboarding_get","x-cli":"node cli/atomiks.mjs onboarding.get --json '{...}'","x-session-only":false,"summary":"Ver meus primeiros passos","description":"Checklist \"Primeiros passos\" da conta atual para o próprio usuário: grupos com passos marcados sozinhos pelo que já existe na conta (número conectado, conta de anúncios, contatos, venda...). Passos de telas que o usuário não acessa ficam de fora. `dismissed`: o usuário pulou o checklist nesta conta.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"href":{"type":"string"},"done":{"type":"boolean"}},"required":["key","title","description","href","done"],"additionalProperties":false}}},"required":["key","title","steps"],"additionalProperties":false}},"done":{"type":"number"},"total":{"type":"number"},"dismissed":{"type":"boolean"}},"required":["groups","done","total","dismissed"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/onboarding.dismiss":{"post":{"operationId":"onboarding.dismiss","tags":["onboarding"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/onboarding.dismiss.md"},"x-mcp-tool":"onboarding_dismiss","x-cli":"node cli/atomiks.mjs onboarding.dismiss --json '{...}'","x-session-only":false,"summary":"Pular ou retomar meus primeiros passos","description":"`dismissed: true` esconde o checklist \"Primeiros passos\" para o próprio usuário na conta atual; `false` mostra de novo.","x-scope":null,"x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dismissed":{"type":"boolean"}},"required":["dismissed"]},"example":{"dismissed":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dismissed":{"type":"boolean"}},"required":["dismissed"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/search.global":{"post":{"operationId":"search.global","tags":["search"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/search.global.md"},"x-mcp-tool":"search_global","x-cli":"node cli/atomiks.mjs search.global --json '{...}'","x-session-only":false,"summary":"Busca global (paleta ⌘K)","description":"Busca por nome em contatos (nome, telefone, e-mail, instagram), oportunidades, listas, segmentos, tags, pipelines, flows e produtos da conta atual. `q` com 2+ caracteres; `types` restringe os tipos; `limit` por tipo (até 20, padrão 5). Volta grupos na ordem fixa dos tipos, sem grupo vazio, cada item com `href` para abrir no app. Tipos sem acesso (plano, permissão do membro ou escopo da chave) ficam de fora sem erro.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","minLength":2,"maxLength":100},"types":{"maxItems":8,"type":"array","items":{"type":"string","enum":["contact","opportunity","list","segment","tag","pipeline","flow","product"]}},"limit":{"default":5,"type":"integer","minimum":1,"maximum":20}},"required":["q"]},"example":{"q":"maria","types":["contact","opportunity"],"limit":5}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["contact","opportunity","list","segment","tag","pipeline","flow","product"]},"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["contact","opportunity","list","segment","tag","pipeline","flow","product"]},"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"href":{"type":"string"},"status":{"type":["string","null"]},"valueCents":{"type":["number","null"]},"color":{"type":["string","null"]},"emoji":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["type","id","title","subtitle","href","status","valueCents","color","emoji","thumbnailUrl","updatedAt"],"additionalProperties":false}}},"required":["type","items"],"additionalProperties":false}}},"required":["groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.list":{"post":{"operationId":"attendants.list","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.list.md"},"x-mcp-tool":"attendants_list","x-cli":"node cli/atomiks.mjs attendants.list --json '{...}'","x-session-only":false,"summary":"Listar atendentes com números","description":"Membros da conta que são atendentes, cada um com tipos, pipelines e números das oportunidades de que é responsável (ganhas, perdidas, receita ganha, comissão, reuniões, conversão), mais os totais do topo da tela (`kpis`, calculados sobre todos, sem o filtro). `search` filtra pelo nome. Número sem fonte vem `null`. Sem a migration de atendentes, tipos e pipelines vêm vazios.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"color":{"type":["string","null"]},"role":{"type":"string","enum":["admin","user"]},"createdAt":{"type":"string"},"meetingRoomUrl":{"type":["string","null"]},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"stats":{"type":"object","properties":{"opportunities":{"type":"number"},"openOpportunities":{"type":"number"},"wonOpportunities":{"type":"number"},"lostOpportunities":{"type":"number"},"wonValueCents":{"type":"number"},"commissionCents":{"type":["number","null"]},"meetingsScheduled":{"type":"number"},"meetingsCompleted":{"type":"number"},"conversion":{"type":["number","null"]}},"required":["opportunities","openOpportunities","wonOpportunities","lostOpportunities","wonValueCents","commissionCents","meetingsScheduled","meetingsCompleted","conversion"],"additionalProperties":false}},"required":["id","name","initials","imageUrl","color","role","createdAt","meetingRoomUrl","types","pipelines","stats"],"additionalProperties":false}},"kpis":{"type":"object","properties":{"totalAttendants":{"type":"number"},"withOpportunities":{"type":"number"},"totalRevenueCents":{"type":"number"},"avgRevenuePerAttendantCents":{"type":"number"},"avgConversion":{"type":"number"},"totalOpportunities":{"type":"number"},"avgOpportunitiesPerAttendant":{"type":"number"}},"required":["totalAttendants","withOpportunities","totalRevenueCents","avgRevenuePerAttendantCents","avgConversion","totalOpportunities","avgOpportunitiesPerAttendant"],"additionalProperties":false}},"required":["items","kpis"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.get":{"post":{"operationId":"attendants.get","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.get.md"},"x-mcp-tool":"attendants_get","x-cli":"node cli/atomiks.mjs attendants.get --json '{...}'","x-session-only":false,"summary":"Ver um atendente","description":"Um atendente com tipos, pipelines, sala de reunião e números. `id` é o do usuário (membro da conta).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"color":{"type":["string","null"]},"role":{"type":"string","enum":["admin","user"]},"createdAt":{"type":"string"},"meetingRoomUrl":{"type":["string","null"]},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"stats":{"type":"object","properties":{"opportunities":{"type":"number"},"openOpportunities":{"type":"number"},"wonOpportunities":{"type":"number"},"lostOpportunities":{"type":"number"},"wonValueCents":{"type":"number"},"commissionCents":{"type":["number","null"]},"meetingsScheduled":{"type":"number"},"meetingsCompleted":{"type":"number"},"conversion":{"type":["number","null"]}},"required":["opportunities","openOpportunities","wonOpportunities","lostOpportunities","wonValueCents","commissionCents","meetingsScheduled","meetingsCompleted","conversion"],"additionalProperties":false}},"required":["id","name","initials","imageUrl","color","role","createdAt","meetingRoomUrl","types","pipelines","stats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.update":{"post":{"operationId":"attendants.update","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.update.md"},"x-mcp-tool":"attendants_update","x-cli":"node cli/atomiks.mjs attendants.update --json '{...}'","x-session-only":false,"summary":"Editar um atendente","description":"Altera o nome de exibição (`name`; `null` volta ao nome do perfil) e a sala de reunião (`meetingRoomUrl`, link http/https; vazio ou `null` limpa). Só o que for enviado muda. Exige a migration de atendentes (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"meetingRoomUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","meetingRoomUrl":"https://meet.google.com/abc-defg-hij"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"color":{"type":["string","null"]},"role":{"type":"string","enum":["admin","user"]},"createdAt":{"type":"string"},"meetingRoomUrl":{"type":["string","null"]},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"stats":{"type":"object","properties":{"opportunities":{"type":"number"},"openOpportunities":{"type":"number"},"wonOpportunities":{"type":"number"},"lostOpportunities":{"type":"number"},"wonValueCents":{"type":"number"},"commissionCents":{"type":["number","null"]},"meetingsScheduled":{"type":"number"},"meetingsCompleted":{"type":"number"},"conversion":{"type":["number","null"]}},"required":["opportunities","openOpportunities","wonOpportunities","lostOpportunities","wonValueCents","commissionCents","meetingsScheduled","meetingsCompleted","conversion"],"additionalProperties":false}},"required":["id","name","initials","imageUrl","color","role","createdAt","meetingRoomUrl","types","pipelines","stats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.remove":{"post":{"operationId":"attendants.remove","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.remove.md"},"x-mcp-tool":"attendants_remove","x-cli":"node cli/atomiks.mjs attendants.remove --json '{...}'","x-session-only":false,"summary":"Excluir um atendente","description":"Tira a pessoa da lista de atendentes e solta seus tipos, pipelines e canais. O membro continua na conta (para remover da conta use `members.remove`) e as oportunidades dele não mudam de responsável. Exige a migration de atendentes.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.set_types":{"post":{"operationId":"attendants.set_types","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.set_types.md"},"x-mcp-tool":"attendants_set_types","x-cli":"node cli/atomiks.mjs attendants.set_types --json '{...}'","x-session-only":false,"summary":"Definir os tipos de um atendente","description":"Troca o conjunto de tipos do atendente por `attendantTypeIds` (lista vazia tira todos). Devolve o atendente atualizado.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantTypeIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","attendantTypeIds"]},"example":{"id":"00000000-0000-0000-0000-000000000000","attendantTypeIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"color":{"type":["string","null"]},"role":{"type":"string","enum":["admin","user"]},"createdAt":{"type":"string"},"meetingRoomUrl":{"type":["string","null"]},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"stats":{"type":"object","properties":{"opportunities":{"type":"number"},"openOpportunities":{"type":"number"},"wonOpportunities":{"type":"number"},"lostOpportunities":{"type":"number"},"wonValueCents":{"type":"number"},"commissionCents":{"type":["number","null"]},"meetingsScheduled":{"type":"number"},"meetingsCompleted":{"type":"number"},"conversion":{"type":["number","null"]}},"required":["opportunities","openOpportunities","wonOpportunities","lostOpportunities","wonValueCents","commissionCents","meetingsScheduled","meetingsCompleted","conversion"],"additionalProperties":false}},"required":["id","name","initials","imageUrl","color","role","createdAt","meetingRoomUrl","types","pipelines","stats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.set_pipelines":{"post":{"operationId":"attendants.set_pipelines","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.set_pipelines.md"},"x-mcp-tool":"attendants_set_pipelines","x-cli":"node cli/atomiks.mjs attendants.set_pipelines --json '{...}'","x-session-only":false,"summary":"Definir os pipelines de um atendente","description":"Troca o conjunto de pipelines em que o atendente participa por `pipelineIds`. Quem já estava mantém o peso do rodízio; quem entra começa com 5. Devolve o atendente atualizado.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pipelineIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","pipelineIds"]},"example":{"id":"00000000-0000-0000-0000-000000000000","pipelineIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"color":{"type":["string","null"]},"role":{"type":"string","enum":["admin","user"]},"createdAt":{"type":"string"},"meetingRoomUrl":{"type":["string","null"]},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"stats":{"type":"object","properties":{"opportunities":{"type":"number"},"openOpportunities":{"type":"number"},"wonOpportunities":{"type":"number"},"lostOpportunities":{"type":"number"},"wonValueCents":{"type":"number"},"commissionCents":{"type":["number","null"]},"meetingsScheduled":{"type":"number"},"meetingsCompleted":{"type":"number"},"conversion":{"type":["number","null"]}},"required":["opportunities","openOpportunities","wonOpportunities","lostOpportunities","wonValueCents","commissionCents","meetingsScheduled","meetingsCompleted","conversion"],"additionalProperties":false}},"required":["id","name","initials","imageUrl","color","role","createdAt","meetingRoomUrl","types","pipelines","stats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.channels_get":{"post":{"operationId":"attendants.channels_get","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.channels_get.md"},"x-mcp-tool":"attendants_channels_get","x-cli":"node cli/atomiks.mjs attendants.channels_get --json '{...}'","x-session-only":false,"summary":"Ver os canais de um atendente","description":"Ids dos canais (números/contas conectados) que o atendente atende. Sem a migration de atendentes, vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelInstanceIds":{"type":"array","items":{"type":"string"}}},"required":["channelInstanceIds"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.channels_set":{"post":{"operationId":"attendants.channels_set","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.channels_set.md"},"x-mcp-tool":"attendants_channels_set","x-cli":"node cli/atomiks.mjs attendants.channels_set --json '{...}'","x-session-only":false,"summary":"Definir os canais de um atendente","description":"Troca os canais do atendente por `channelInstanceIds` (ids de `channels.list`; lista vazia tira todos).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelInstanceIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","channelInstanceIds"]},"example":{"id":"00000000-0000-0000-0000-000000000000","channelInstanceIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelInstanceIds":{"type":"array","items":{"type":"string"}}},"required":["channelInstanceIds"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendant_types.list":{"post":{"operationId":"attendant_types.list","tags":["attendant_types"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendant_types.list.md"},"x-mcp-tool":"attendant_types_list","x-cli":"node cli/atomiks.mjs attendant_types.list --json '{...}'","x-session-only":false,"summary":"Listar tipos de atendente","description":"Tipos de atendente da conta em ordem, cada um com nome, descrição, ícone (`emoji`, nome do ícone), cor e quantos atendentes o têm. Sem a migration de atendentes, lista vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"position":{"type":"number"},"memberCount":{"type":"number"}},"required":["id","name","emoji","color","description","position","memberCount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendant_types.create":{"post":{"operationId":"attendant_types.create","tags":["attendant_types"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendant_types.create.md"},"x-mcp-tool":"attendant_types_create","x-cli":"node cli/atomiks.mjs attendant_types.create --json '{...}'","x-session-only":false,"summary":"Criar tipo de atendente","description":"Cria um tipo (ex.: SDR, Closer) com nome único na conta, descrição, ícone (`emoji`, nome do ícone) e cor `#rrggbb` opcionais. Vai para o fim da ordem.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"emoji":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]}},"required":["name"]},"example":{"name":"Closer","emoji":"User","color":"#3b82f6"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"position":{"type":"number"},"memberCount":{"type":"number"}},"required":["id","name","emoji","color","description","position","memberCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendant_types.update":{"post":{"operationId":"attendant_types.update","tags":["attendant_types"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendant_types.update.md"},"x-mcp-tool":"attendant_types_update","x-cli":"node cli/atomiks.mjs attendant_types.update --json '{...}'","x-session-only":false,"summary":"Editar tipo de atendente","description":"Altera nome, descrição, ícone ou cor de um tipo; só o que for enviado muda (`null` limpa descrição, ícone e cor).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"emoji":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Closer sênior"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"position":{"type":"number"},"memberCount":{"type":"number"}},"required":["id","name","emoji","color","description","position","memberCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendant_types.delete":{"post":{"operationId":"attendant_types.delete","tags":["attendant_types"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendant_types.delete.md"},"x-mcp-tool":"attendant_types_delete","x-cli":"node cli/atomiks.mjs attendant_types.delete --json '{...}'","x-session-only":false,"summary":"Excluir tipo de atendente","description":"Exclui o tipo; ele sai dos atendentes e das configurações de pipeline (comissão incluída). Os atendentes continuam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.attendant_types_get":{"post":{"operationId":"pipelines.attendant_types_get","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.attendant_types_get.md"},"x-mcp-tool":"pipelines_attendant_types_get","x-cli":"node cli/atomiks.mjs pipelines.attendant_types_get --json '{...}'","x-session-only":false,"summary":"Ver tipos de atendente e atendentes de um pipeline","description":"Tipos de atendente usados no pipeline, com a comissão de cada um (`commissionType` `percentage` em pontos-base, 100 = 1%, ou `fixed` em centavos por oportunidade ganha), e os atendentes do pipeline com o peso do rodízio (0 a 10). Sem a migration de atendentes, vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":"string"},"attendantTypeName":{"type":"string"},"attendantTypeEmoji":{"type":["string","null"]},"attendantTypeColor":{"type":["string","null"]},"commissionType":{"anyOf":[{"type":"string","enum":["percentage","fixed"]},{"type":"null"}]},"commissionPercentBp":{"type":["number","null"]},"commissionFixedCents":{"type":["number","null"]}},"required":["attendantTypeId","attendantTypeName","attendantTypeEmoji","attendantTypeColor","commissionType","commissionPercentBp","commissionFixedCents"],"additionalProperties":false}},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"weight":{"type":"number"}},"required":["attendantId","weight"],"additionalProperties":false}}},"required":["items","attendants"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.attendant_types_set":{"post":{"operationId":"pipelines.attendant_types_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.attendant_types_set.md"},"x-mcp-tool":"pipelines_attendant_types_set","x-cli":"node cli/atomiks.mjs pipelines.attendant_types_set --json '{...}'","x-session-only":false,"summary":"Definir tipos de atendente e comissão de um pipeline","description":"Troca os tipos do pipeline por `types`, na ordem enviada. Cada um pode ter comissão: `percentage` exige `commissionPercentBp` (0 a 10000, 100 = 1%) e `fixed` exige `commissionFixedCents`; sem `commissionType` fica sem comissão. Devolve o mesmo que `pipelines.attendant_types_get`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"types":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"commissionType":{"anyOf":[{"type":"string","enum":["percentage","fixed"]},{"type":"null"}]},"commissionPercentBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"commissionFixedCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["attendantTypeId"]}}},"required":["pipelineId","types"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","types":[{"attendantTypeId":"00000000-0000-0000-0000-000000000000","commissionType":"percentage","commissionPercentBp":500}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":"string"},"attendantTypeName":{"type":"string"},"attendantTypeEmoji":{"type":["string","null"]},"attendantTypeColor":{"type":["string","null"]},"commissionType":{"anyOf":[{"type":"string","enum":["percentage","fixed"]},{"type":"null"}]},"commissionPercentBp":{"type":["number","null"]},"commissionFixedCents":{"type":["number","null"]}},"required":["attendantTypeId","attendantTypeName","attendantTypeEmoji","attendantTypeColor","commissionType","commissionPercentBp","commissionFixedCents"],"additionalProperties":false}},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"weight":{"type":"number"}},"required":["attendantId","weight"],"additionalProperties":false}}},"required":["items","attendants"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.attendants_set":{"post":{"operationId":"pipelines.attendants_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.attendants_set.md"},"x-mcp-tool":"pipelines_attendants_set","x-cli":"node cli/atomiks.mjs pipelines.attendants_set --json '{...}'","x-session-only":false,"summary":"Definir os atendentes de um pipeline","description":"Troca os atendentes do pipeline por `attendantIds` (ids de usuário de `attendants.list`). Quem já estava mantém o peso do rodízio; quem entra começa com 5. Devolve o mesmo que `pipelines.attendant_types_get`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["pipelineId","attendantIds"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","attendantIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":"string"},"attendantTypeName":{"type":"string"},"attendantTypeEmoji":{"type":["string","null"]},"attendantTypeColor":{"type":["string","null"]},"commissionType":{"anyOf":[{"type":"string","enum":["percentage","fixed"]},{"type":"null"}]},"commissionPercentBp":{"type":["number","null"]},"commissionFixedCents":{"type":["number","null"]}},"required":["attendantTypeId","attendantTypeName","attendantTypeEmoji","attendantTypeColor","commissionType","commissionPercentBp","commissionFixedCents"],"additionalProperties":false}},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"weight":{"type":"number"}},"required":["attendantId","weight"],"additionalProperties":false}}},"required":["items","attendants"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.attendant_routing_set":{"post":{"operationId":"pipelines.attendant_routing_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.attendant_routing_set.md"},"x-mcp-tool":"pipelines_attendant_routing_set","x-cli":"node cli/atomiks.mjs pipelines.attendant_routing_set --json '{...}'","x-session-only":false,"summary":"Definir o peso de um atendente no rodízio do pipeline","description":"Peso (0 a 10, padrão 5) que o atendente tem no rodízio de distribuição deste pipeline. O atendente precisa estar no pipeline (`pipelines.attendants_set`).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"weight":{"type":"integer","minimum":0,"maximum":10}},"required":["pipelineId","attendantId","weight"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","attendantId":"00000000-0000-0000-0000-000000000000","weight":5}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string"},"attendantId":{"type":"string"},"weight":{"type":"number"}},"required":["pipelineId","attendantId","weight"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.availability_get":{"post":{"operationId":"attendants.availability_get","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.availability_get.md"},"x-mcp-tool":"attendants_availability_get","x-cli":"node cli/atomiks.mjs attendants.availability_get --json '{...}'","x-session-only":false,"summary":"Ver a disponibilidade semanal de um atendente","description":"Fuso e faixas de horário por dia da semana (`dayOfWeek` 0 = domingo a 6 = sábado, `startTime`/`endTime` em HH:mm). Sem disponibilidade gravada (ou sem a migration), `timezone` vem `null` e `slots` vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string"},"timezone":{"type":["string","null"]},"slots":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"endTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime","endTime"],"additionalProperties":false}}},"required":["attendantId","timezone","slots"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.availability_set":{"post":{"operationId":"attendants.availability_set","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.availability_set.md"},"x-mcp-tool":"attendants_availability_set","x-cli":"node cli/atomiks.mjs attendants.availability_set --json '{...}'","x-session-only":false,"summary":"Definir a disponibilidade semanal de um atendente","description":"Troca o fuso e todas as faixas semanais do atendente (lista vazia = indisponível a semana toda). Faixas válidas têm início antes do fim e não se sobrepõem no mesmo dia; senão `invalid_input`. O próprio atendente ou um administrador. Exige a migration de disponibilidade (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"slots":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"endTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime","endTime"]}}},"required":["id","timezone","slots"]},"example":{"id":"00000000-0000-0000-0000-000000000000","timezone":"America/Sao_Paulo","slots":[{"dayOfWeek":1,"startTime":"09:00","endTime":"17:00"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string"},"timezone":{"type":["string","null"]},"slots":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"endTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime","endTime"],"additionalProperties":false}}},"required":["attendantId","timezone","slots"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.availability_overrides_list":{"post":{"operationId":"attendants.availability_overrides_list","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.availability_overrides_list.md"},"x-mcp-tool":"attendants_availability_overrides_list","x-cli":"node cli/atomiks.mjs attendants.availability_overrides_list --json '{...}'","x-session-only":false,"summary":"Listar exceções de disponibilidade de um atendente","description":"Exceções por data em ordem: `isBlocked` true = indisponível (o dia todo se `startTime`/`endTime` vêm `null`, ou só a faixa); false = faixa extra. Até 500, da mais antiga à mais nova.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"isBlocked":{"type":"boolean"},"startTime":{"type":["string","null"]},"endTime":{"type":["string","null"]}},"required":["id","date","isBlocked","startTime","endTime"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.availability_override_create":{"post":{"operationId":"attendants.availability_override_create","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.availability_override_create.md"},"x-mcp-tool":"attendants_availability_override_create","x-cli":"node cli/atomiks.mjs attendants.availability_override_create --json '{...}'","x-session-only":false,"summary":"Criar exceção de disponibilidade","description":"Marca uma data (`AAAA-MM-DD`) como indisponível (`isBlocked` true, padrão; sem horário vale o dia todo, com `startTime` e `endTime` só a faixa) ou acrescenta uma faixa extra (`isBlocked` false, exige as duas horas). O próprio atendente ou um administrador.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"isBlocked":{"default":true,"type":"boolean"},"startTime":{"anyOf":[{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}]},"endTime":{"anyOf":[{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}]}},"required":["id","date"]},"example":{"id":"00000000-0000-0000-0000-000000000000","date":"2026-12-25","isBlocked":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"isBlocked":{"type":"boolean"},"startTime":{"type":["string","null"]},"endTime":{"type":["string","null"]}},"required":["id","date","isBlocked","startTime","endTime"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.availability_override_delete":{"post":{"operationId":"attendants.availability_override_delete","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.availability_override_delete.md"},"x-mcp-tool":"attendants_availability_override_delete","x-cli":"node cli/atomiks.mjs attendants.availability_override_delete --json '{...}'","x-session-only":false,"summary":"Remover exceção de disponibilidade","description":"Apaga uma exceção pelo id (de `attendants.availability_overrides_list`). O próprio atendente ou um administrador.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.calendars_get":{"post":{"operationId":"attendants.calendars_get","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.calendars_get.md"},"x-mcp-tool":"attendants_calendars_get","x-cli":"node cli/atomiks.mjs attendants.calendars_get --json '{...}'","x-session-only":false,"summary":"Ver os calendários de um atendente","description":"Calendários externos (Google, Outlook) ligados ao atendente que bloqueiam horários na agenda. O Atomiks ainda não integra calendários externos: `externalCalendars` vem sempre vazio e a agenda usa só a disponibilidade (`attendants.availability_get`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string"},"name":{"type":"string"},"externalCalendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"calendarId":{"type":"string"}},"required":["id","provider","calendarId"],"additionalProperties":false}}},"required":["attendantId","name","externalCalendars"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.activity":{"post":{"operationId":"attendants.activity","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.activity.md"},"x-mcp-tool":"attendants_activity","x-cli":"node cli/atomiks.mjs attendants.activity --json '{...}'","x-session-only":false,"summary":"Atividades de um atendente","description":"Linha do tempo das ações da pessoa, do mais recente para o mais antigo (30 por página; `cursor` = `nextCursor` da resposta anterior). Junta o que o Atomiks grava com ela como autora: atendimentos (atribuição, transferência, resolução), autorização de envio de mensagens (opt-in/opt-out) alterada, conversas (mensagens enviadas por conversa e dia), notas internas, tarefas criadas e concluídas, oportunidades criadas, ganhas e perdidas em que é responsável e compras registradas à mão. Cada item traz `eventName` (nome do evento equivalente no Clickmax), `title`, `subtitle` e `look` (tipo de cor e ícone). Cada fonte entra com as 100 linhas mais recentes. Só mostra o que o chamador pode ver.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"cursor":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"createdAt":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"look":{"type":"string","enum":["attendanceHuman","link","note","leadTask","statusWon","statusLost","created","purchase","channelWhatsapp","channelInstagram","default"]},"actorName":{"type":"string"}},"required":["id","eventName","createdAt","title","subtitle","look","actorName"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attendants.activity_summary":{"post":{"operationId":"attendants.activity_summary","tags":["attendants"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/attendants.activity_summary.md"},"x-mcp-tool":"attendants_activity_summary","x-cli":"node cli/atomiks.mjs attendants.activity_summary --json '{...}'","x-session-only":false,"summary":"Resumo de atividade de um atendente","description":"Cartão-resumo que aparece ao passar o mouse no avatar da linha do tempo: nome e tipos, atividades (total, 7 e 30 dias, série diária dos últimos 30 dias, hora de pico no fuso da conta, tipos mais frequentes), oportunidades (em aberto, ganhas e valor ganho nos últimos 30 dias, em centavos) e as 5 atividades mais recentes. Conta as 100 linhas mais recentes de cada fonte de `attendants.activity`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendant":{"type":"object","properties":{"name":{"type":"string"},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]}},"required":["id","name","emoji","color"],"additionalProperties":false}}},"required":["name","types"],"additionalProperties":false},"activity":{"type":"object","properties":{"total":{"type":"number"},"last7Days":{"type":"number"},"last30Days":{"type":"number"},"timeseries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"],"additionalProperties":false}},"peakHour":{"type":["number","null"]},"peakHourCount":{"type":"number"},"topEventTypes":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"}},"required":["eventName","label","count"],"additionalProperties":false}}},"required":["total","last7Days","last30Days","timeseries","peakHour","peakHourCount","topEventTypes"],"additionalProperties":false},"opportunities":{"type":"object","properties":{"open":{"type":"number"},"wonLast30Days":{"type":"number"},"wonValueLast30Days":{"type":"number"}},"required":["open","wonLast30Days","wonValueLast30Days"],"additionalProperties":false},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"label":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","eventName","label","createdAt"],"additionalProperties":false}}},"required":["attendant","activity","opportunities","recent"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm.opportunities_bulk_attendants":{"post":{"operationId":"crm.opportunities_bulk_attendants","tags":["crm"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/crm.opportunities_bulk_attendants.md"},"x-mcp-tool":"crm_opportunities_bulk_attendants","x-cli":"node cli/atomiks.mjs crm.opportunities_bulk_attendants --json '{...}'","x-session-only":false,"summary":"Atribuir atendentes a várias oportunidades","description":"Troca os atendentes de várias oportunidades de uma vez (`POST /v2/opportunities/bulk-action/attendants` do original). Escolha as oportunidades por `cardIds` ou por `allMatching: true` com `scope` (`pipelineId`, `stageId` opcional e `filters` opcional com `status` e `attendantIds`, o responsável atual; outro filtro dá `invalid_input`). `assignments` leva um atendente por papel (`attendantTypeId`); o principal (`isPrimary`, ou o primeiro) vira o responsável (`owner_id`) da oportunidade e os outros ficam como atendentes por papel. Substitui os atendentes que a oportunidade tinha. Só atua em oportunidades que o chamador pode ver; as demais entram em `skipped`. Até 5000 por chamada, sempre síncrono (`mode: \"sync\"`, `jobId: null`). Exige a migration de disponibilidade (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filters":{"type":"object","properties":{"status":{"type":"string","enum":["open","won","lost"]},"attendantIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false}},"required":["pipelineId"]},"assignments":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantTypeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"isPrimary":{"type":"boolean"}},"required":["attendantId"]}}},"required":["assignments"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"assignments":[{"attendantId":"00000000-0000-0000-0000-000000000000","attendantTypeId":"00000000-0000-0000-0000-000000000000","isPrimary":true}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.list":{"post":{"operationId":"teams.list","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.list.md"},"x-mcp-tool":"teams_list","x-cli":"node cli/atomiks.mjs teams.list --json '{...}'","x-session-only":false,"summary":"Listar times","description":"Times de distribuição da conta, do mais antigo ao mais novo, cada um com nome, slug, descrição, ícone (`emoji`, nome do ícone), cor da marca (`color`, o mesmo valor de `brandColor`), logo, modo de distribuição e quantos membros tem (`memberCount`, o mesmo valor de `totalMembers`), com a contagem por tipo de atendente (`memberTypeCounts`; `attendantTypeId` nulo = sem tipo). `appointmentSchedules` traz as agendas do time (mesmo formato de `scheduling.schedules_list`; vazio sem a migration de agendas). Sem a migration de times, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"brandColor":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"memberCount":{"type":"number"},"totalMembers":{"type":"number"},"memberTypeCounts":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":["string","null"]},"name":{"type":["string","null"]},"color":{"type":["string","null"]},"emoji":{"type":["string","null"]},"count":{"type":"number"}},"required":["attendantTypeId","name","color","emoji","count"],"additionalProperties":false}},"appointmentSchedules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"distributionMode":{"type":"string","enum":["weighted","strict"]},"strictRespectCaps":{"type":"boolean"},"queueCursorMemberId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","slug","description","emoji","color","brandColor","logoUrl","memberCount","totalMembers","memberTypeCounts","appointmentSchedules","distributionMode","strictRespectCaps","queueCursorMemberId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.get":{"post":{"operationId":"teams.get","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.get.md"},"x-mcp-tool":"teams_get","x-cli":"node cli/atomiks.mjs teams.get --json '{...}'","x-session-only":false,"summary":"Ver um time","description":"Um time com os membros em ordem da fila. Cada membro traz papel (`admin` ou `member`), prioridade (1 a 10, menor = mais prioridade), peso (1 a 1000), `isFixed` (atendente fixo), `capOpen` (limite de atendimentos abertos, `null` = sem limite), regras por temperatura (`temperatureRules`: `hot`, `warm`, `cold`, cada uma com `cap`), `operational` (ainda é atendente) e `inPipeline` (está em algum pipeline; `null` sem a migration de atendentes). `queueCursorMemberId` é quem recebeu por último no modo `strict`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"brandColor":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"memberCount":{"type":"number"},"totalMembers":{"type":"number"},"memberTypeCounts":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":["string","null"]},"name":{"type":["string","null"]},"color":{"type":["string","null"]},"emoji":{"type":["string","null"]},"count":{"type":"number"}},"required":["attendantTypeId","name","color","emoji","count"],"additionalProperties":false}},"appointmentSchedules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"distributionMode":{"type":"string","enum":["weighted","strict"]},"strictRespectCaps":{"type":"boolean"},"queueCursorMemberId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["id","name","slug","description","emoji","color","brandColor","logoUrl","memberCount","totalMembers","memberTypeCounts","appointmentSchedules","distributionMode","strictRespectCaps","queueCursorMemberId","createdAt","updatedAt","members"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.create":{"post":{"operationId":"teams.create","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.create.md"},"x-mcp-tool":"teams_create","x-cli":"node cli/atomiks.mjs teams.create --json '{...}'","x-session-only":false,"summary":"Criar time","description":"Cria um time. `slug` (letras minúsculas, números e hífen) é gerado do nome quando vazio e é único na conta (gerado repetido ganha `-2`, `-3`; informado repetido dá `invalid_input`). `emoji` é o nome do ícone; `color`/`brandColor` são `#rrggbb`. Começa no modo `weighted` e sem membros. Exige a migration de times (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"emoji":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"brandColor":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"logoUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]},"example":{"name":"Time Comercial","description":"Atende os leads novos"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"brandColor":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"memberCount":{"type":"number"},"totalMembers":{"type":"number"},"memberTypeCounts":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":["string","null"]},"name":{"type":["string","null"]},"color":{"type":["string","null"]},"emoji":{"type":["string","null"]},"count":{"type":"number"}},"required":["attendantTypeId","name","color","emoji","count"],"additionalProperties":false}},"appointmentSchedules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"distributionMode":{"type":"string","enum":["weighted","strict"]},"strictRespectCaps":{"type":"boolean"},"queueCursorMemberId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["id","name","slug","description","emoji","color","brandColor","logoUrl","memberCount","totalMembers","memberTypeCounts","appointmentSchedules","distributionMode","strictRespectCaps","queueCursorMemberId","createdAt","updatedAt","members"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.update":{"post":{"operationId":"teams.update","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.update.md"},"x-mcp-tool":"teams_update","x-cli":"node cli/atomiks.mjs teams.update --json '{...}'","x-session-only":false,"summary":"Editar time","description":"Altera nome, slug, descrição, ícone, cor da marca (`color` ou `brandColor`), logo, modo de distribuição (`weighted` = rodízio por peso e prioridade; `strict` = fila 1 a 1) e `strictRespectCaps` (no modo `strict`, pular quem atingiu o limite). Só o que for enviado muda; `null` limpa descrição, ícone, cor e logo. Slug repetido dá `invalid_input`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"emoji":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"brandColor":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"logoUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"distributionMode":{"type":"string","enum":["weighted","strict"]},"strictRespectCaps":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","distributionMode":"strict"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"brandColor":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"memberCount":{"type":"number"},"totalMembers":{"type":"number"},"memberTypeCounts":{"type":"array","items":{"type":"object","properties":{"attendantTypeId":{"type":["string","null"]},"name":{"type":["string","null"]},"color":{"type":["string","null"]},"emoji":{"type":["string","null"]},"count":{"type":"number"}},"required":["attendantTypeId","name","color","emoji","count"],"additionalProperties":false}},"appointmentSchedules":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"distributionMode":{"type":"string","enum":["weighted","strict"]},"strictRespectCaps":{"type":"boolean"},"queueCursorMemberId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["id","name","slug","description","emoji","color","brandColor","logoUrl","memberCount","totalMembers","memberTypeCounts","appointmentSchedules","distributionMode","strictRespectCaps","queueCursorMemberId","createdAt","updatedAt","members"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.delete":{"post":{"operationId":"teams.delete","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.delete.md"},"x-mcp-tool":"teams_delete","x-cli":"node cli/atomiks.mjs teams.delete --json '{...}'","x-session-only":false,"summary":"Excluir time","description":"Exclui o time com seus membros e regras. As pessoas continuam na conta e como atendentes.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.members_list":{"post":{"operationId":"teams.members_list","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.members_list.md"},"x-mcp-tool":"teams_members_list","x-cli":"node cli/atomiks.mjs teams.members_list --json '{...}'","x-session-only":false,"summary":"Listar membros de um time","description":"Membros do time na ordem da fila, com papel, prioridade, peso, atendente fixo, limite de atendimentos abertos e regras por temperatura (mesmo formato de `teams.get`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["teamId"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.members_add":{"post":{"operationId":"teams.members_add","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.members_add.md"},"x-mcp-tool":"teams_members_add","x-cli":"node cli/atomiks.mjs teams.members_add --json '{...}'","x-session-only":false,"summary":"Adicionar atendentes a um time","description":"Põe os atendentes (`attendantIds`, ids de `attendants.list`) no fim da fila do time. Começam como `member`, prioridade 5, peso 100, sem limite e sem regra de temperatura. Quem já está no time é ignorado. Devolve todos os membros do time.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["teamId","attendantIds"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","attendantIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.members_update":{"post":{"operationId":"teams.members_update","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.members_update.md"},"x-mcp-tool":"teams_members_update","x-cli":"node cli/atomiks.mjs teams.members_update --json '{...}'","x-session-only":false,"summary":"Editar um membro do time","description":"Altera o papel (`admin` ou `member`), a prioridade (1 a 10, menor = mais prioridade), o peso (1 a 1000), `isFixed` e o limite de atendimentos abertos (`capOpen` >= 1; `null` = sem limite). Só o que for enviado muda. As regras por temperatura têm operações próprias (`teams.member_temperature_rule_*`). `memberId` é o `id` do membro (de `teams.get`), não o do atendente.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"integer","minimum":1,"maximum":10},"weight":{"type":"integer","minimum":1,"maximum":1000},"isFixed":{"type":"boolean"},"capOpen":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["teamId","memberId"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberId":"00000000-0000-0000-0000-000000000000","weight":200,"capOpen":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.members_remove":{"post":{"operationId":"teams.members_remove","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.members_remove.md"},"x-mcp-tool":"teams_members_remove","x-cli":"node cli/atomiks.mjs teams.members_remove --json '{...}'","x-session-only":false,"summary":"Remover um membro do time","description":"Tira o membro do time (e suas regras por temperatura). A pessoa continua na conta e como atendente.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["teamId","memberId"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.member_temperature_rule_set":{"post":{"operationId":"teams.member_temperature_rule_set","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.member_temperature_rule_set.md"},"x-mcp-tool":"teams_member_temperature_rule_set","x-cli":"node cli/atomiks.mjs teams.member_temperature_rule_set --json '{...}'","x-session-only":false,"summary":"Definir a regra de uma temperatura de um membro","description":"Liga a temperatura (`hot`, `warm` ou `cold`) para o membro e define o limite de atendimentos dela (`cap` >= 1; `null` ou omitido = sem limite). Já ligada: troca o limite. Devolve o membro.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["teamId","memberId","temperature"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberId":"00000000-0000-0000-0000-000000000000","temperature":"hot","cap":5}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.member_temperature_rule_delete":{"post":{"operationId":"teams.member_temperature_rule_delete","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.member_temperature_rule_delete.md"},"x-mcp-tool":"teams_member_temperature_rule_delete","x-cli":"node cli/atomiks.mjs teams.member_temperature_rule_delete --json '{...}'","x-session-only":false,"summary":"Desligar uma temperatura de um membro","description":"Tira a temperatura (`hot`, `warm` ou `cold`) do membro: ele deixa de receber leads dessa temperatura. Temperatura que já estava desligada não dá erro. Devolve o membro.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"temperature":{"type":"string","enum":["hot","warm","cold"]}},"required":["teamId","memberId","temperature"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberId":"00000000-0000-0000-0000-000000000000","temperature":"cold"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.member_temperature_rules_set":{"post":{"operationId":"teams.member_temperature_rules_set","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.member_temperature_rules_set.md"},"x-mcp-tool":"teams_member_temperature_rules_set","x-cli":"node cli/atomiks.mjs teams.member_temperature_rules_set --json '{...}'","x-session-only":false,"summary":"Definir todas as regras de temperatura de um membro","description":"Troca o conjunto de regras do membro por `rules` (cada temperatura uma vez, `cap` >= 1 ou `null` = sem limite). Lista vazia desliga todas as temperaturas. Devolve o membro.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rules":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"]}}},"required":["teamId","memberId","rules"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberId":"00000000-0000-0000-0000-000000000000","rules":[{"temperature":"hot","cap":5},{"temperature":"warm","cap":null}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.queue_order_set":{"post":{"operationId":"teams.queue_order_set","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.queue_order_set.md"},"x-mcp-tool":"teams_queue_order_set","x-cli":"node cli/atomiks.mjs teams.queue_order_set --json '{...}'","x-session-only":false,"summary":"Definir a ordem da fila do time","description":"Define a ordem da fila do modo `strict` (1 a 1): `memberIds` são os `id` dos membros e precisam ser exatamente os membros do time, uma vez cada (senão `invalid_input`). Devolve os membros na nova ordem.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["teamId","memberIds"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","memberIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"role":{"type":"string","enum":["admin","member"]},"priority":{"type":"number"},"weight":{"type":"number"},"isFixed":{"type":"boolean"},"capOpen":{"type":["number","null"]},"active":{"type":"boolean"},"operational":{"type":"boolean"},"inPipeline":{"type":["boolean","null"]},"position":{"type":"number"},"temperatureRules":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"cap":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]}},"required":["temperature","cap"],"additionalProperties":false}}},"required":["id","teamId","attendantId","attendantName","name","initials","imageUrl","role","priority","weight","isFixed","capOpen","active","operational","inPipeline","position","temperatureRules"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.stats":{"post":{"operationId":"teams.stats","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.stats.md"},"x-mcp-tool":"teams_stats","x-cli":"node cli/atomiks.mjs teams.stats --json '{...}'","x-session-only":false,"summary":"Estatísticas de um time","description":"Números da aba Estatísticas do time no período (`from` e `to`, ISO 8601; ambos opcionais = todo o histórico): reuniões por membro (`memberCalls`), cards por membro (`memberCards`) e distribuição por temperatura (`temperatureDistribution`, só as temperaturas com contagem). Calculado das tarefas de reunião e das oportunidades do Atomiks: `completed` = reuniões concluídas no período; `cancelled` e `no_show` não existem aqui e vêm 0; `openCards` = oportunidades abertas criadas no período e `wonCards` = ganhas no período, de que o membro é responsável; temperatura = faixa do contato das abertas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string"},"to":{"type":"string"}},"required":["teamId"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000","from":"2026-09-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"memberCalls":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":"string"},"completed":{"type":"number"},"cancelled":{"type":"number"},"no_show":{"type":"number"}},"required":["attendantId","attendantName","completed","cancelled","no_show"],"additionalProperties":false}},"memberCards":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":"string"},"openCards":{"type":"number"},"wonCards":{"type":"number"}},"required":["attendantId","attendantName","openCards","wonCards"],"additionalProperties":false}},"temperatureDistribution":{"type":"array","items":{"type":"object","properties":{"temperature":{"type":"string","enum":["hot","warm","cold"]},"count":{"type":"number"}},"required":["temperature","count"],"additionalProperties":false}}},"required":["memberCalls","memberCards","temperatureDistribution"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams.member_calendars":{"post":{"operationId":"teams.member_calendars","tags":["teams"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/teams.member_calendars.md"},"x-mcp-tool":"teams_member_calendars","x-cli":"node cli/atomiks.mjs teams.member_calendars --json '{...}'","x-session-only":false,"summary":"Calendários externos dos membros de um time","description":"Calendários externos (Google, Outlook) dos membros do time para a agenda do time. O Atomiks ainda não integra calendários externos: `items` vem sempre vazio e `members` traz cada membro com `externalCalendars` vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["teamId"]},"example":{"teamId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"members":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"name":{"type":"string"},"externalCalendars":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["attendantId","name","externalCalendars"],"additionalProperties":false}}},"required":["items","members"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedules_list":{"post":{"operationId":"scheduling.schedules_list","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedules_list.md"},"x-mcp-tool":"scheduling_schedules_list","x-cli":"node cli/atomiks.mjs scheduling.schedules_list --json '{...}'","x-session-only":false,"summary":"Listar agendas","description":"Agendas da conta, da mais antiga à mais nova, com tudo que o formulário do original edita (ver `scheduling.schedules_create`) e `attendantName`, `teamName`, `teamColor` e `publicPath` (`/book/{workspaceSlug}/{slug}` quando pública). `ownerType` filtra por time (`team`) ou atendente (`attendant`); `teamId` e `attendantId` filtram por dono. Cada atendente ativo ganha uma agenda pessoal (`isPersonal`, com o nome do atendente) na primeira listagem. Sem a migration, a lista traz só as agendas pessoais de cada atendente ativo, montadas em memória (`id` `pessoal:<atendente>`, padrões da criação): a leitura funciona e qualquer escrita responde `migration_pendente`. Ids `pessoal:<atendente>` valem também em `schedules_get`, `available_slots` e nas notificações.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ownerType":{"type":"string","enum":["team","attendant"]},"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{"ownerType":"attendant"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"duration":{"type":"number"},"color":{"type":["string","null"]},"isPublic":{"type":"boolean"},"isPersonal":{"type":"boolean"},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"type":["string","null"]},"memberId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"teamId":{"type":["string","null"]},"teamName":{"type":["string","null"]},"teamColor":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"stageId":{"type":["string","null"]},"bufferMinutes":{"type":"number"},"minNoticeMinutes":{"type":"number"},"maxBookingsPerDay":{"type":["number","null"]},"maxBookingsPerMemberPerDay":{"type":["number","null"]},"maxAdvanceDays":{"type":["number","null"]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"number"},"rollingWindowStepDays":{"type":"number"},"confirmationMessage":{"type":["string","null"]},"bookingFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"required":{"type":"boolean"},"customFieldId":{"type":"string"}},"required":["field","required"],"additionalProperties":false}},"confirmationButtons":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"variant":{"type":"string"}},"required":["id","label","type","value","variant"],"additionalProperties":false}},{"type":"null"}]},"redirectUrl":{"type":["string","null"]},"pixelId":{"type":["string","null"]},"redirectDelaySeconds":{"type":["number","null"]},"emailLayoutTemplateId":{"type":["string","null"]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"type":["string","null"]},"otpWhatsappTemplateId":{"type":["string","null"]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"type":["string","null"]},"meetPlaybookId":{"type":["string","null"]},"meetCopilotAgentId":{"type":["string","null"]},"memberCalendars":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"externalCalendarIds":{"type":"array","items":{"type":"string"}}},"required":["attendantId","externalCalendarIds"],"additionalProperties":false}},"groupCapacity":{"type":"number"},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"],"additionalProperties":false}},"publicPath":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","slug","description","duration","color","isPublic","isPersonal","schedulingType","attendantId","memberId","attendantName","teamId","teamName","teamColor","pipelineId","stageId","bufferMinutes","minNoticeMinutes","maxBookingsPerDay","maxBookingsPerMemberPerDay","maxAdvanceDays","rollingWindowEnabled","rollingWindowThresholdPercent","rollingWindowStepDays","confirmationMessage","bookingFields","confirmationButtons","redirectUrl","pixelId","redirectDelaySeconds","emailLayoutTemplateId","otpVerificationEnabled","otpChannel","otpEmailSenderSignatureId","otpWhatsappTemplateId","meetingLocationMode","meetingLocationUrl","meetPlaybookId","meetCopilotAgentId","memberCalendars","groupCapacity","groupShowSeatsLeft","sessionRules","publicPath","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedules_get":{"post":{"operationId":"scheduling.schedules_get","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedules_get.md"},"x-mcp-tool":"scheduling_schedules_get","x-cli":"node cli/atomiks.mjs scheduling.schedules_get --json '{...}'","x-session-only":false,"summary":"Ver uma agenda","description":"Uma agenda com todos os campos do formulário (mesmo formato de `scheduling.schedules_list`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"duration":{"type":"number"},"color":{"type":["string","null"]},"isPublic":{"type":"boolean"},"isPersonal":{"type":"boolean"},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"type":["string","null"]},"memberId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"teamId":{"type":["string","null"]},"teamName":{"type":["string","null"]},"teamColor":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"stageId":{"type":["string","null"]},"bufferMinutes":{"type":"number"},"minNoticeMinutes":{"type":"number"},"maxBookingsPerDay":{"type":["number","null"]},"maxBookingsPerMemberPerDay":{"type":["number","null"]},"maxAdvanceDays":{"type":["number","null"]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"number"},"rollingWindowStepDays":{"type":"number"},"confirmationMessage":{"type":["string","null"]},"bookingFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"required":{"type":"boolean"},"customFieldId":{"type":"string"}},"required":["field","required"],"additionalProperties":false}},"confirmationButtons":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"variant":{"type":"string"}},"required":["id","label","type","value","variant"],"additionalProperties":false}},{"type":"null"}]},"redirectUrl":{"type":["string","null"]},"pixelId":{"type":["string","null"]},"redirectDelaySeconds":{"type":["number","null"]},"emailLayoutTemplateId":{"type":["string","null"]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"type":["string","null"]},"otpWhatsappTemplateId":{"type":["string","null"]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"type":["string","null"]},"meetPlaybookId":{"type":["string","null"]},"meetCopilotAgentId":{"type":["string","null"]},"memberCalendars":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"externalCalendarIds":{"type":"array","items":{"type":"string"}}},"required":["attendantId","externalCalendarIds"],"additionalProperties":false}},"groupCapacity":{"type":"number"},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"],"additionalProperties":false}},"publicPath":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","slug","description","duration","color","isPublic","isPersonal","schedulingType","attendantId","memberId","attendantName","teamId","teamName","teamColor","pipelineId","stageId","bufferMinutes","minNoticeMinutes","maxBookingsPerDay","maxBookingsPerMemberPerDay","maxAdvanceDays","rollingWindowEnabled","rollingWindowThresholdPercent","rollingWindowStepDays","confirmationMessage","bookingFields","confirmationButtons","redirectUrl","pixelId","redirectDelaySeconds","emailLayoutTemplateId","otpVerificationEnabled","otpChannel","otpEmailSenderSignatureId","otpWhatsappTemplateId","meetingLocationMode","meetingLocationUrl","meetPlaybookId","meetCopilotAgentId","memberCalendars","groupCapacity","groupShowSeatsLeft","sessionRules","publicPath","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedules_create":{"post":{"operationId":"scheduling.schedules_create","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedules_create.md"},"x-mcp-tool":"scheduling_schedules_create","x-cli":"node cli/atomiks.mjs scheduling.schedules_create --json '{...}'","x-session-only":false,"summary":"Criar agenda","description":"Cria uma agenda. Dono: `attendantId` (ou `memberId`, o mesmo id) para `individual`/`group`, ou `teamId` para `round_robin` (padrão quando só há `teamId`); sem dono `invalid_input`. `duration` 5 a 480 min (padrão 30). `slug` (3 a 48 letras minúsculas, números e hífen, único na conta) é gerado do nome quando a agenda é pública e ele vem vazio. `bookingFields` são as perguntas do formulário (`field`: name, email, secondaryEmail, telephone, whatsappNumber, instagram, linkedin, twitterX, tiktok, youtube, observations, city, state, document, birthday ou `custom` + `customFieldId`; nome e e-mail são sempre obrigatórios). `meetingLocationMode`: `clickmax_meet`, `google_meet` (padrão), `attendant_room` ou `fixed_link` (exige `meetingLocationUrl` http/https). Agenda `group` exige `groupCapacity` (1 a 100) e `sessionRules` (dia da semana + HH:mm que cabe no mesmo dia). `bufferMinutes` (intervalo), `minNoticeMinutes`, `maxAdvanceDays`, `maxBookingsPerDay` e `maxBookingsPerMemberPerDay` limitam os horários. `memberCalendars` define quem do time participa (vazio = todo o time). Com `isPublic`, valem também confirmação, botões, redirecionamento, pixel e verificação por código. `rollingWindow*` é só gravado (a janela rolante ainda não afeta os horários). Exige a migration de agendas (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"duration":{"default":30,"type":"integer","minimum":5,"maximum":480},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"isPublic":{"default":false,"type":"boolean"},"slug":{"type":"string","maxLength":48},"pipelineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"stageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bufferMinutes":{"default":0,"type":"integer","minimum":0,"maximum":1440},"minNoticeMinutes":{"default":0,"type":"integer","minimum":0,"maximum":525600},"maxBookingsPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"maxBookingsPerMemberPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"integer","minimum":1,"maximum":100},"rollingWindowStepDays":{"type":"integer","minimum":1,"maximum":30},"confirmationMessage":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"bookingFields":{"anyOf":[{"maxItems":40,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","secondaryEmail","telephone","whatsappNumber","instagram","linkedin","twitterX","tiktok","youtube","observations","city","state","document","birthday","custom"]},"required":{"type":"boolean"},"customFieldId":{"type":"string","minLength":1,"maxLength":100}},"required":["field","required"]}},{"type":"null"}]},"confirmationButtons":{"anyOf":[{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","maxLength":100},"type":{"type":"string","enum":["link","whatsapp","email","download"]},"value":{"type":"string","maxLength":2000},"variant":{"default":"primary","type":"string","minLength":1,"maxLength":40}},"required":["id","label","type","value"]}},{"type":"null"}]},"redirectUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"pixelId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"redirectDelaySeconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":60},{"type":"null"}]},"emailLayoutTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"otpWhatsappTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"meetPlaybookId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"meetCopilotAgentId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"groupCapacity":{"type":"integer","minimum":1,"maximum":100},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"]}},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"memberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"memberCalendars":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalCalendarIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["attendantId"]}}},"required":["name"]},"example":{"name":"Reunião de apresentação","duration":30,"bufferMinutes":0,"minNoticeMinutes":0,"attendantId":"00000000-0000-0000-0000-000000000000","isPublic":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"duration":{"type":"number"},"color":{"type":["string","null"]},"isPublic":{"type":"boolean"},"isPersonal":{"type":"boolean"},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"type":["string","null"]},"memberId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"teamId":{"type":["string","null"]},"teamName":{"type":["string","null"]},"teamColor":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"stageId":{"type":["string","null"]},"bufferMinutes":{"type":"number"},"minNoticeMinutes":{"type":"number"},"maxBookingsPerDay":{"type":["number","null"]},"maxBookingsPerMemberPerDay":{"type":["number","null"]},"maxAdvanceDays":{"type":["number","null"]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"number"},"rollingWindowStepDays":{"type":"number"},"confirmationMessage":{"type":["string","null"]},"bookingFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"required":{"type":"boolean"},"customFieldId":{"type":"string"}},"required":["field","required"],"additionalProperties":false}},"confirmationButtons":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"variant":{"type":"string"}},"required":["id","label","type","value","variant"],"additionalProperties":false}},{"type":"null"}]},"redirectUrl":{"type":["string","null"]},"pixelId":{"type":["string","null"]},"redirectDelaySeconds":{"type":["number","null"]},"emailLayoutTemplateId":{"type":["string","null"]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"type":["string","null"]},"otpWhatsappTemplateId":{"type":["string","null"]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"type":["string","null"]},"meetPlaybookId":{"type":["string","null"]},"meetCopilotAgentId":{"type":["string","null"]},"memberCalendars":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"externalCalendarIds":{"type":"array","items":{"type":"string"}}},"required":["attendantId","externalCalendarIds"],"additionalProperties":false}},"groupCapacity":{"type":"number"},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"],"additionalProperties":false}},"publicPath":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","slug","description","duration","color","isPublic","isPersonal","schedulingType","attendantId","memberId","attendantName","teamId","teamName","teamColor","pipelineId","stageId","bufferMinutes","minNoticeMinutes","maxBookingsPerDay","maxBookingsPerMemberPerDay","maxAdvanceDays","rollingWindowEnabled","rollingWindowThresholdPercent","rollingWindowStepDays","confirmationMessage","bookingFields","confirmationButtons","redirectUrl","pixelId","redirectDelaySeconds","emailLayoutTemplateId","otpVerificationEnabled","otpChannel","otpEmailSenderSignatureId","otpWhatsappTemplateId","meetingLocationMode","meetingLocationUrl","meetPlaybookId","meetCopilotAgentId","memberCalendars","groupCapacity","groupShowSeatsLeft","sessionRules","publicPath","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedules_update":{"post":{"operationId":"scheduling.schedules_update","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedules_update.md"},"x-mcp-tool":"scheduling_schedules_update","x-cli":"node cli/atomiks.mjs scheduling.schedules_update --json '{...}'","x-session-only":false,"summary":"Editar agenda","description":"Só o que for enviado muda (mesmos campos de `scheduling.schedules_create`); texto vazio ou `null` limpa. Trocar o dono (`attendantId`/`memberId` ou `teamId`) limpa o outro lado e o roster; a agenda pessoal mantém o dono. Tornar pública sem slug gera um do nome. Slug repetido dá `invalid_input`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"duration":{"type":"integer","minimum":5,"maximum":480},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"isPublic":{"type":"boolean"},"slug":{"type":"string","maxLength":48},"pipelineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"stageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bufferMinutes":{"type":"integer","minimum":0,"maximum":1440},"minNoticeMinutes":{"type":"integer","minimum":0,"maximum":525600},"maxBookingsPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"maxBookingsPerMemberPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"integer","minimum":1,"maximum":100},"rollingWindowStepDays":{"type":"integer","minimum":1,"maximum":30},"confirmationMessage":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"bookingFields":{"anyOf":[{"maxItems":40,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","email","secondaryEmail","telephone","whatsappNumber","instagram","linkedin","twitterX","tiktok","youtube","observations","city","state","document","birthday","custom"]},"required":{"type":"boolean"},"customFieldId":{"type":"string","minLength":1,"maxLength":100}},"required":["field","required"]}},{"type":"null"}]},"confirmationButtons":{"anyOf":[{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","maxLength":100},"type":{"type":"string","enum":["link","whatsapp","email","download"]},"value":{"type":"string","maxLength":2000},"variant":{"default":"primary","type":"string","minLength":1,"maxLength":40}},"required":["id","label","type","value"]}},{"type":"null"}]},"redirectUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"pixelId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"redirectDelaySeconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":60},{"type":"null"}]},"emailLayoutTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"otpWhatsappTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"meetPlaybookId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"meetCopilotAgentId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"groupCapacity":{"type":"integer","minimum":1,"maximum":100},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"]}},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"memberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"memberCalendars":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"externalCalendarIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["attendantId"]}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","duration":45,"bufferMinutes":10}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"duration":{"type":"number"},"color":{"type":["string","null"]},"isPublic":{"type":"boolean"},"isPersonal":{"type":"boolean"},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"attendantId":{"type":["string","null"]},"memberId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"teamId":{"type":["string","null"]},"teamName":{"type":["string","null"]},"teamColor":{"type":["string","null"]},"pipelineId":{"type":["string","null"]},"stageId":{"type":["string","null"]},"bufferMinutes":{"type":"number"},"minNoticeMinutes":{"type":"number"},"maxBookingsPerDay":{"type":["number","null"]},"maxBookingsPerMemberPerDay":{"type":["number","null"]},"maxAdvanceDays":{"type":["number","null"]},"rollingWindowEnabled":{"type":"boolean"},"rollingWindowThresholdPercent":{"type":"number"},"rollingWindowStepDays":{"type":"number"},"confirmationMessage":{"type":["string","null"]},"bookingFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"required":{"type":"boolean"},"customFieldId":{"type":"string"}},"required":["field","required"],"additionalProperties":false}},"confirmationButtons":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"variant":{"type":"string"}},"required":["id","label","type","value","variant"],"additionalProperties":false}},{"type":"null"}]},"redirectUrl":{"type":["string","null"]},"pixelId":{"type":["string","null"]},"redirectDelaySeconds":{"type":["number","null"]},"emailLayoutTemplateId":{"type":["string","null"]},"otpVerificationEnabled":{"type":"boolean"},"otpChannel":{"type":"string","enum":["email","whatsapp"]},"otpEmailSenderSignatureId":{"type":["string","null"]},"otpWhatsappTemplateId":{"type":["string","null"]},"meetingLocationMode":{"type":"string","enum":["clickmax_meet","google_meet","attendant_room","fixed_link"]},"meetingLocationUrl":{"type":["string","null"]},"meetPlaybookId":{"type":["string","null"]},"meetCopilotAgentId":{"type":["string","null"]},"memberCalendars":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"externalCalendarIds":{"type":"array","items":{"type":"string"}}},"required":["attendantId","externalCalendarIds"],"additionalProperties":false}},"groupCapacity":{"type":"number"},"groupShowSeatsLeft":{"type":"boolean"},"sessionRules":{"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"],"additionalProperties":false}},"publicPath":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","slug","description","duration","color","isPublic","isPersonal","schedulingType","attendantId","memberId","attendantName","teamId","teamName","teamColor","pipelineId","stageId","bufferMinutes","minNoticeMinutes","maxBookingsPerDay","maxBookingsPerMemberPerDay","maxAdvanceDays","rollingWindowEnabled","rollingWindowThresholdPercent","rollingWindowStepDays","confirmationMessage","bookingFields","confirmationButtons","redirectUrl","pixelId","redirectDelaySeconds","emailLayoutTemplateId","otpVerificationEnabled","otpChannel","otpEmailSenderSignatureId","otpWhatsappTemplateId","meetingLocationMode","meetingLocationUrl","meetPlaybookId","meetCopilotAgentId","memberCalendars","groupCapacity","groupShowSeatsLeft","sessionRules","publicPath","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedules_delete":{"post":{"operationId":"scheduling.schedules_delete","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedules_delete.md"},"x-mcp-tool":"scheduling_schedules_delete","x-cli":"node cli/atomiks.mjs scheduling.schedules_delete --json '{...}'","x-session-only":false,"summary":"Excluir agenda","description":"Exclui a agenda com roster e notificações. A agenda pessoal do atendente não pode ser excluída (`invalid_input`). Reuniões já marcadas continuam como tarefas.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedulable_members":{"post":{"operationId":"scheduling.schedulable_members","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedulable_members.md"},"x-mcp-tool":"scheduling_schedulable_members","x-cli":"node cli/atomiks.mjs scheduling.schedulable_members --json '{...}'","x-session-only":false,"summary":"Listar quem pode ser escolhido numa agenda","description":"Atendentes da conta que podem ter agenda: os papéis de `scheduling.settings_get` (`schedulableRoles`; `seatRole` = `owner` para quem criou a conta, `admin` ou `member`), por nome. `attendantId`, `personId` e `memberId` são o mesmo id (o usuário). `hasAvailability` = tem faixas semanais em `attendants.availability_set`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"personId":{"type":"string"},"memberId":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"imageUrl":{"type":["string","null"]},"seatRole":{"type":"string","enum":["owner","admin","member"]},"hasAvailability":{"type":"boolean"}},"required":["attendantId","personId","memberId","name","initials","imageUrl","seatRole","hasAvailability"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.settings_get":{"post":{"operationId":"scheduling.settings_get","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.settings_get.md"},"x-mcp-tool":"scheduling_settings_get","x-cli":"node cli/atomiks.mjs scheduling.settings_get --json '{...}'","x-session-only":false,"summary":"Ver os ajustes de agendamento","description":"Ajustes da conta: `timezone` (fuso do negócio; sem ajuste vale o da conta, em geral America/Sao_Paulo), `workspaceSlug` (trecho do link público /book/{workspaceSlug}/{slug}; sem ajuste vale o id da conta), as chaves `googleMeetAutoLink`, `bidirectionalCalendarSync`, `autoNoShow`, `meetingRecording`, `meetingRecordingVideo` e `schedulableRoles` (`owner`, `admin`, `member`: quem pode ser escolhido nas agendas). Sem a migration, vêm os padrões.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"workspaceSlug":{"type":"string"},"googleMeetAutoLink":{"type":"boolean"},"bidirectionalCalendarSync":{"type":"boolean"},"autoNoShow":{"type":"boolean"},"meetingRecording":{"type":"boolean"},"meetingRecordingVideo":{"type":"boolean"},"schedulableRoles":{"type":"array","items":{"type":"string","enum":["owner","admin","member"]}}},"required":["timezone","workspaceSlug","googleMeetAutoLink","bidirectionalCalendarSync","autoNoShow","meetingRecording","meetingRecordingVideo","schedulableRoles"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.settings_set":{"post":{"operationId":"scheduling.settings_set","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.settings_set.md"},"x-mcp-tool":"scheduling_settings_set","x-cli":"node cli/atomiks.mjs scheduling.settings_set --json '{...}'","x-session-only":false,"summary":"Alterar os ajustes de agendamento","description":"Só o que for enviado muda. `timezone` e `workspaceSlug` aceitam `null` para voltar ao padrão (`workspaceSlug`: 3 a 48 letras minúsculas, números e hífen, único entre as contas, senão `invalid_input`). Devolve os ajustes. Exige a migration de agendas (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"workspaceSlug":{"anyOf":[{"type":"string","pattern":"^[a-z0-9-]{3,48}$"},{"type":"null"}]},"googleMeetAutoLink":{"type":"boolean"},"bidirectionalCalendarSync":{"type":"boolean"},"autoNoShow":{"type":"boolean"},"meetingRecording":{"type":"boolean"},"meetingRecordingVideo":{"type":"boolean"},"schedulableRoles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["owner","admin","member"]}}}},"example":{"timezone":"America/Sao_Paulo","schedulableRoles":["owner","admin"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"workspaceSlug":{"type":"string"},"googleMeetAutoLink":{"type":"boolean"},"bidirectionalCalendarSync":{"type":"boolean"},"autoNoShow":{"type":"boolean"},"meetingRecording":{"type":"boolean"},"meetingRecordingVideo":{"type":"boolean"},"schedulableRoles":{"type":"array","items":{"type":"string","enum":["owner","admin","member"]}}},"required":["timezone","workspaceSlug","googleMeetAutoLink","bidirectionalCalendarSync","autoNoShow","meetingRecording","meetingRecordingVideo","schedulableRoles"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedule_notifications_list":{"post":{"operationId":"scheduling.schedule_notifications_list","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedule_notifications_list.md"},"x-mcp-tool":"scheduling_schedule_notifications_list","x-cli":"node cli/atomiks.mjs scheduling.schedule_notifications_list --json '{...}'","x-session-only":false,"summary":"Listar notificações de uma agenda","description":"Notificações da agenda, da mais antiga à mais nova: quem recebe (`recipient`: `lead` ou `attendant`), quando (`direction` antes/depois da reunião, `offsetMinutes`, `atTime` HH:mm só quando o prazo é em dias), por qual canal (`internal` só para o atendente; `email`, `sms`, `whatsapp`, `tag` só para o lead) e o conteúdo. `mode` é `active` ou `paused`. `flowId` vem vazio: o disparo ainda não está ligado aos flows do Atomiks. Até 5 por agenda. Sem a migration, vem vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scheduleId":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}},"required":["scheduleId"]},"example":{"scheduleId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scheduleId":{"type":"string"},"recipeKey":{"type":"string"},"flowId":{"type":["string","null"]},"mode":{"type":"string","enum":["active","paused"]},"active":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","scheduleId","recipeKey","flowId","mode","active","config"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedule_notifications_create":{"post":{"operationId":"scheduling.schedule_notifications_create","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedule_notifications_create.md"},"x-mcp-tool":"scheduling_schedule_notifications_create","x-cli":"node cli/atomiks.mjs scheduling.schedule_notifications_create --json '{...}'","x-session-only":false,"summary":"Criar notificação de uma agenda","description":"Cria a notificação (começa `active`). Regras do original: atendente só recebe `internal` (exige `title` e `message`); lead não recebe `internal`; `email` exige `emailSubject` e `message`; `sms` exige `message`; `whatsapp` exige `gupshupTemplateId` (o template aprovado; `gupshupAppId` é o número de envio); `tag` exige `tagIds`. `atTime` só com prazo em dias. Até 5 por agenda (`limit_reached`). Exige a migration de agendas.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scheduleId":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"config":{"type":"object","properties":{"recipient":{"type":"string","enum":["lead","attendant"]},"direction":{"type":"string","enum":["before","after"]},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600},"atTime":{"anyOf":[{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}]},"channel":{"type":"string","enum":["internal","email","sms","whatsapp","tag"]},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"emailSubject":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"emailHtml":{"type":"boolean"},"tagIds":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"gupshupTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"gupshupAppId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"templateParams":{"anyOf":[{"maxItems":50,"type":"array","items":{}},{"type":"null"}]}},"required":["recipient","direction","offsetMinutes","channel"]}},"required":["scheduleId","config"]},"example":{"scheduleId":"00000000-0000-0000-0000-000000000000","config":{"recipient":"lead","direction":"before","offsetMinutes":60,"channel":"email","emailSubject":"Sua reunião é daqui a pouco","message":"Nos vemos em 1 hora."}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"scheduleId":{"type":"string"},"recipeKey":{"type":"string"},"flowId":{"type":["string","null"]},"mode":{"type":"string","enum":["active","paused"]},"active":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","scheduleId","recipeKey","flowId","mode","active","config"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedule_notifications_update":{"post":{"operationId":"scheduling.schedule_notifications_update","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedule_notifications_update.md"},"x-mcp-tool":"scheduling_schedule_notifications_update","x-cli":"node cli/atomiks.mjs scheduling.schedule_notifications_update --json '{...}'","x-session-only":false,"summary":"Editar notificação de uma agenda","description":"Troca a configuração inteira (`config`, mesmas regras de `scheduling.schedule_notifications_create`); o estado ativo/pausado não muda.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"config":{"type":"object","properties":{"recipient":{"type":"string","enum":["lead","attendant"]},"direction":{"type":"string","enum":["before","after"]},"offsetMinutes":{"type":"integer","minimum":0,"maximum":525600},"atTime":{"anyOf":[{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"type":"null"}]},"channel":{"type":"string","enum":["internal","email","sms","whatsapp","tag"]},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"emailSubject":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"emailHtml":{"type":"boolean"},"tagIds":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"gupshupTemplateId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"gupshupAppId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"templateParams":{"anyOf":[{"maxItems":50,"type":"array","items":{}},{"type":"null"}]}},"required":["recipient","direction","offsetMinutes","channel"]}},"required":["id","config"]},"example":{"id":"00000000-0000-0000-0000-000000000000","config":{"recipient":"attendant","direction":"before","offsetMinutes":15,"channel":"internal","title":"Reunião em 15 min","message":"Prepare-se."}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"scheduleId":{"type":"string"},"recipeKey":{"type":"string"},"flowId":{"type":["string","null"]},"mode":{"type":"string","enum":["active","paused"]},"active":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","scheduleId","recipeKey","flowId","mode","active","config"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedule_notifications_delete":{"post":{"operationId":"scheduling.schedule_notifications_delete","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedule_notifications_delete.md"},"x-mcp-tool":"scheduling_schedule_notifications_delete","x-cli":"node cli/atomiks.mjs scheduling.schedule_notifications_delete --json '{...}'","x-session-only":false,"summary":"Excluir notificação de uma agenda","description":"Apaga a notificação pelo id (de `scheduling.schedule_notifications_list`).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.schedule_notifications_set_active":{"post":{"operationId":"scheduling.schedule_notifications_set_active","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.schedule_notifications_set_active.md"},"x-mcp-tool":"scheduling_schedule_notifications_set_active","x-cli":"node cli/atomiks.mjs scheduling.schedule_notifications_set_active --json '{...}'","x-session-only":false,"summary":"Ativar ou pausar uma notificação","description":"Liga (`active` true, `mode` `active`) ou pausa (`mode` `paused`) a notificação sem apagar a configuração. Devolve a notificação.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"active":{"type":"boolean"}},"required":["id","active"]},"example":{"id":"00000000-0000-0000-0000-000000000000","active":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"scheduleId":{"type":"string"},"recipeKey":{"type":"string"},"flowId":{"type":["string","null"]},"mode":{"type":"string","enum":["active","paused"]},"active":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","scheduleId","recipeKey","flowId","mode","active","config"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.availability_preview":{"post":{"operationId":"scheduling.availability_preview","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.availability_preview.md"},"x-mcp-tool":"scheduling_availability_preview","x-cli":"node cli/atomiks.mjs scheduling.availability_preview --json '{...}'","x-session-only":false,"summary":"Pré-visualizar os horários de uma agenda","description":"Horários livres de uma agenda ainda não salva, para a prévia do formulário. `scheduleDraft`: `durationMinutes` e os limites (`bufferMinutes`, `minNoticeMinutes`, `maxAdvanceDays`, `maxBookingsPerDay`, `maxBookingsPerMemberPerDay`) e quem atende: `memberIds` (o roster), ou `attendantId`, ou `teamId` (todo o time). Para `schedulingType` `group`, `sessionRules` são as sessões. `from` e `to` (AAAA-MM-DD, no máximo 62 dias, no fuso do negócio). Devolve `days` (dias com horário livre) e `slots` (`startAt`/`endAt` ISO e `memberIds` livres), no mesmo cálculo de `scheduling.available_slots`: horário semanal e exceções de `attendants.availability_*`, menos as reuniões já marcadas (tarefas `meeting`), com folga de `bufferMinutes`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scheduleDraft":{"type":"object","properties":{"durationMinutes":{"type":"integer","minimum":5,"maximum":480},"bufferMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"minNoticeMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":525600},{"type":"null"}]},"maxAdvanceDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}]},"maxBookingsPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"maxBookingsPerMemberPerDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"schedulingType":{"type":"string","enum":["individual","group","round_robin"]},"memberIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sessionRules":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"startTime":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"}},"required":["dayOfWeek","startTime"]}}},"required":["durationMinutes"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["scheduleDraft","from","to"]},"example":{"scheduleDraft":{"durationMinutes":30,"bufferMinutes":10,"attendantId":"00000000-0000-0000-0000-000000000000"},"from":"2026-11-01","to":"2026-11-30"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"days":{"type":"array","items":{"type":"string"}},"slots":{"type":"array","items":{"type":"object","properties":{"startAt":{"type":"string"},"endAt":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["startAt","endAt","memberIds"],"additionalProperties":false}}},"required":["timezone","days","slots"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.available_slots":{"post":{"operationId":"scheduling.available_slots","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.available_slots.md"},"x-mcp-tool":"scheduling_available_slots","x-cli":"node cli/atomiks.mjs scheduling.available_slots --json '{...}'","x-session-only":false,"summary":"Horários livres de uma agenda","description":"Horários livres da agenda salva em [`from`, `to`] (AAAA-MM-DD, no máximo 62 dias, no fuso do negócio de `scheduling.settings_get`). Usa a duração, os intervalos, a antecedência mínima/máxima e os limites por dia da agenda, o horário semanal e as exceções de quem atende (`attendants.availability_*`) e as reuniões já marcadas (tarefas `meeting`). Em agenda de time, o horário existe se ao menos um participante está livre (`memberIds` lista quem). Agenda `group` devolve as sessões de `sessionRules`. Devolve `days` e `slots`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scheduleId":{"type":"string","pattern":"^(pessoal:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["scheduleId","from","to"]},"example":{"scheduleId":"00000000-0000-0000-0000-000000000000","from":"2026-11-01","to":"2026-11-30"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timezone":{"type":"string"},"days":{"type":"array","items":{"type":"string"}},"slots":{"type":"array","items":{"type":"object","properties":{"startAt":{"type":"string"},"endAt":{"type":"string"},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["startAt","endAt","memberIds"],"additionalProperties":false}}},"required":["timezone","days","slots"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.recordings_token":{"post":{"operationId":"scheduling.recordings_token","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.recordings_token.md"},"x-mcp-tool":"scheduling_recordings_token","x-cli":"node cli/atomiks.mjs scheduling.recordings_token --json '{...}'","x-session-only":false,"summary":"Gerar o token de pareamento da extensão de gravação","description":"Gera um token de curta duração (10 minutos) para a extensão do Chrome se conectar a esta conta e registra o navegador em `scheduling.recordings_devices_list` (`deviceKey` identifica o navegador: reconectar o mesmo reaproveita o registro e reativa se tinha sido revogado). O token em claro só vem nesta resposta; o banco guarda o hash. Exige a gravação de reuniões ligada (`meetingRecording` em `scheduling.settings_set`), senão `forbidden`. Exige a migration de gravações (`migration_pendente` sem ela). Devolve `token` e `expiresAt`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deviceName":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"deviceKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}}},"example":{"deviceName":"Chrome · Windows","deviceKey":"f3b1c9e2-0d0f-4c7e-9a3b-5f6f0a1d2e3c"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string"},"expiresAt":{"type":"string"}},"required":["token","expiresAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.recordings_devices_list":{"post":{"operationId":"scheduling.recordings_devices_list","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.recordings_devices_list.md"},"x-mcp-tool":"scheduling_recordings_devices_list","x-cli":"node cli/atomiks.mjs scheduling.recordings_devices_list --json '{...}'","x-session-only":false,"summary":"Listar os navegadores autorizados para gravar","description":"Navegadores da extensão de gravação autorizados por quem chama nesta conta (os revogados não aparecem), do mais recente ao mais antigo. `lastSeenAt` é nulo enquanto o navegador nunca foi usado. Sem a migration, vem vazio.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deviceName":{"type":["string","null"]},"createdAt":{"type":"string"},"lastSeenAt":{"type":["string","null"]}},"required":["id","deviceName","createdAt","lastSeenAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scheduling.recordings_device_revoke":{"post":{"operationId":"scheduling.recordings_device_revoke","tags":["scheduling"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/scheduling.recordings_device_revoke.md"},"x-mcp-tool":"scheduling_recordings_device_revoke","x-cli":"node cli/atomiks.mjs scheduling.recordings_device_revoke --json '{...}'","x-session-only":false,"summary":"Revogar um navegador da extensão de gravação","description":"Corta a gravação no navegador na hora (o token deixa de valer); dá para reconectar depois com `scheduling.recordings_token`. Só os navegadores de quem chama; outro id responde `not_found`. Exige a migration de gravações (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.list":{"post":{"operationId":"playbooks.list","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.list.md"},"x-mcp-tool":"playbooks_list","x-cli":"node cli/atomiks.mjs playbooks.list --json '{...}'","x-session-only":false,"summary":"Listar playbooks","description":"Playbooks da conta, do mais recém-editado ao mais antigo, com escopos (`meeting`, `livechat`; `whatsapp` e `flows` ainda não estão disponíveis), quantos pipelines usam (`pipelinesCount`) e quantas etapas e perguntas têm. `scope` filtra por escopo (o seletor do cockpit do lead usa `livechat`). Sem a migration, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scope":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}}},"example":{"scope":"livechat"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"pipelinesCount":{"type":"number"},"stagesCount":{"type":"number"},"questionsCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","pipelinesCount","stagesCount","questionsCount","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.get":{"post":{"operationId":"playbooks.get","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.get.md"},"x-mcp-tool":"playbooks_get","x-cli":"node cli/atomiks.mjs playbooks.get --json '{...}'","x-session-only":false,"summary":"Ver um playbook","description":"O playbook completo: etapas (cada uma com `objective`, `talkTrack`, `watchOut` e `questions`), tons de voz, gatilhos por palavra (`keywords`, com `terms`, `text` e `tone` `info`, `warning` ou `urgent`), anexos e proteções (`guardrails`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.create":{"post":{"operationId":"playbooks.create","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.create.md"},"x-mcp-tool":"playbooks_create","x-cli":"node cli/atomiks.mjs playbooks.create --json '{...}'","x-session-only":false,"summary":"Criar playbook","description":"Cria um playbook. Só `name` é obrigatório; `scopes` começa em `[\"meeting\"]`. Limites: 20 etapas, 30 perguntas por etapa, 12 tons, 40 gatilhos (até 12 palavras de 2+ letras cada), 30 anexos e 20 proteções. Ids de etapa, pergunta, tom, gatilho e anexo são texto livre (até 80) e únicos no playbook (`invalid_input` com PLAYBOOK_DUPLICATE_ID). Escopos disponíveis: meeting, livechat (os outros dão PLAYBOOK_SCOPE_NOT_AVAILABLE). Exige a migration de playbooks (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":4000},"scopes":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"]}}},"required":["id","title"]}},"tones":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","maxLength":60},"when":{"default":"","type":"string","maxLength":400},"delivery":{"default":"","type":"string","maxLength":400}},"required":["id","name"]}},"keywords":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"terms":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}},"title":{"default":"","type":"string","maxLength":80},"text":{"type":"string","minLength":1,"maxLength":500},"tone":{"default":"info","type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","text"]}},"attachments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","minLength":1,"maxLength":255},"url":{"type":"string","maxLength":2000},"mimeType":{"default":"application/octet-stream","type":"string","maxLength":200},"size":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","url"]}},"guardrails":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["name"]},"example":{"name":"NEPQ","scopes":["meeting"],"stages":[{"id":"connecting","title":"Conexão","objective":"","talkTrack":"","watchOut":"","questions":[{"id":"connecting-1","text":"O que te fez aceitar essa conversa hoje?"}]}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.update":{"post":{"operationId":"playbooks.update","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.update.md"},"x-mcp-tool":"playbooks_update","x-cli":"node cli/atomiks.mjs playbooks.update --json '{...}'","x-session-only":false,"summary":"Editar playbook","description":"Altera o playbook. Só o que for enviado muda; cada lista enviada (`stages`, `tones`, `keywords`, `attachments`, `guardrails`, `scopes`) substitui a anterior inteira, como no salvar do editor. Mesmas regras de `playbooks.create`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":4000},"scopes":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"]}}},"required":["id","title"]}},"tones":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","maxLength":60},"when":{"default":"","type":"string","maxLength":400},"delivery":{"default":"","type":"string","maxLength":400}},"required":["id","name"]}},"keywords":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"terms":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}},"title":{"default":"","type":"string","maxLength":80},"text":{"type":"string","minLength":1,"maxLength":500},"tone":{"default":"info","type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","text"]}},"attachments":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"name":{"type":"string","minLength":1,"maxLength":255},"url":{"type":"string","maxLength":2000},"mimeType":{"default":"application/octet-stream","type":"string","maxLength":200},"size":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","name","url"]}},"guardrails":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"NEPQ v2","guardrails":["Nunca prometer prazo."]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.delete":{"post":{"operationId":"playbooks.delete","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.delete.md"},"x-mcp-tool":"playbooks_delete","x-cli":"node cli/atomiks.mjs playbooks.delete --json '{...}'","x-session-only":false,"summary":"Excluir playbook","description":"Exclui o playbook. Os pipelines que o usavam ficam sem playbook (`pipelinesCount` em `playbooks.list` diz quantos) e o progresso das conversas nele é apagado.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.pipelines_list":{"post":{"operationId":"playbooks.pipelines_list","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.pipelines_list.md"},"x-mcp-tool":"playbooks_pipelines_list","x-cli":"node cli/atomiks.mjs playbooks.pipelines_list --json '{...}'","x-session-only":false,"summary":"Pipelines de um playbook","description":"Todos os pipelines (não arquivados) da conta. `linked` = o pipeline usa este playbook; `currentPlaybookName` = nome do outro playbook que o pipeline usa hoje (vincular troca por este).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"linked":{"type":"boolean"},"currentPlaybookName":{"type":["string","null"]}},"required":["id","name","linked","currentPlaybookName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.pipeline_attach":{"post":{"operationId":"playbooks.pipeline_attach","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.pipeline_attach.md"},"x-mcp-tool":"playbooks_pipeline_attach","x-cli":"node cli/atomiks.mjs playbooks.pipeline_attach --json '{...}'","x-session-only":false,"summary":"Vincular playbook a um pipeline","description":"O pipeline passa a sugerir este playbook às reuniões. Cada pipeline tem um playbook só: se já tinha outro, este o substitui. Devolve a lista de `playbooks.pipelines_list`. O playbook precisa ter o escopo `meeting`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","pipelineId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"linked":{"type":"boolean"},"currentPlaybookName":{"type":["string","null"]}},"required":["id","name","linked","currentPlaybookName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.pipeline_detach":{"post":{"operationId":"playbooks.pipeline_detach","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.pipeline_detach.md"},"x-mcp-tool":"playbooks_pipeline_detach","x-cli":"node cli/atomiks.mjs playbooks.pipeline_detach --json '{...}'","x-session-only":false,"summary":"Desvincular playbook de um pipeline","description":"Tira o playbook do pipeline (o pipeline fica sem playbook). Pipeline que usava outro playbook não é alterado. Devolve a lista de `playbooks.pipelines_list`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","pipelineId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"linked":{"type":"boolean"},"currentPlaybookName":{"type":["string","null"]}},"required":["id","name","linked","currentPlaybookName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.pipeline_get":{"post":{"operationId":"playbooks.pipeline_get","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.pipeline_get.md"},"x-mcp-tool":"playbooks_pipeline_get","x-cli":"node cli/atomiks.mjs playbooks.pipeline_get --json '{...}'","x-session-only":false,"summary":"Playbook de um pipeline","description":"O playbook que o pipeline sugere às reuniões (`null` se não tem) e o id do agente copiloto padrão (`defaultCopilotAgentId`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"playbook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"defaultCopilotAgentId":{"type":["string","null"]}},"required":["playbook","defaultCopilotAgentId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.pipeline_set":{"post":{"operationId":"playbooks.pipeline_set","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.pipeline_set.md"},"x-mcp-tool":"playbooks_pipeline_set","x-cli":"node cli/atomiks.mjs playbooks.pipeline_set --json '{...}'","x-session-only":false,"summary":"Definir o playbook de um pipeline","description":"Define `playbookId` (`null` = sem playbook; precisa ter o escopo `meeting`) e/ou `defaultCopilotAgentId` (`null` = sem agente). Só o que for enviado muda. Devolve o mesmo formato de `playbooks.pipeline_get`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"playbookId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"defaultCopilotAgentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","playbookId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"playbook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"defaultCopilotAgentId":{"type":["string","null"]}},"required":["playbook","defaultCopilotAgentId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.thread_get":{"post":{"operationId":"playbooks.thread_get","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.thread_get.md"},"x-mcp-tool":"playbooks_thread_get","x-cli":"node cli/atomiks.mjs playbooks.thread_get --json '{...}'","x-session-only":false,"summary":"Playbook de uma conversa","description":"`threadId` é o id da conversa da caixa de entrada. Devolve o playbook da conversa (`source: thread`, escolhido nela, com `progress`: etapa atual e perguntas já marcadas) ou, sem escolha, o do pipeline da oportunidade aberta do contato (`source: pipeline`, `progress` nulo) quando tem o escopo `livechat`. Sem nenhum, `playbook` vem nulo.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"threadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["threadId"]},"example":{"threadId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"playbook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"progress":{"anyOf":[{"type":"object","properties":{"stageId":{"type":["string","null"]},"coveredQuestionIds":{"type":"array","items":{"type":"string"}}},"required":["stageId","coveredQuestionIds"],"additionalProperties":false},{"type":"null"}]},"source":{"anyOf":[{"type":"string","enum":["thread","pipeline"]},{"type":"null"}]}},"required":["playbook","progress","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.thread_set":{"post":{"operationId":"playbooks.thread_set","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.thread_set.md"},"x-mcp-tool":"playbooks_thread_set","x-cli":"node cli/atomiks.mjs playbooks.thread_set --json '{...}'","x-session-only":false,"summary":"Escolher o playbook ou marcar o progresso de uma conversa","description":"Com `playbookId` (escopo `livechat`), a conversa passa a usar esse playbook e o progresso volta ao início (primeira etapa, nenhuma pergunta marcada). Sem `playbookId`, grava o progresso: `stageId` (etapa do playbook) e/ou `coveredQuestionIds` (perguntas do playbook; as desconhecidas são ignoradas). Se a conversa ainda usava o playbook do pipeline, ele passa a ser o dela. `playbookId: null` volta a seguir o pipeline. Devolve o mesmo formato de `playbooks.thread_get`.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"threadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"playbookId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"stageId":{"type":"string","minLength":1,"maxLength":80},"coveredQuestionIds":{"maxItems":600,"type":"array","items":{"type":"string","maxLength":80}}},"required":["threadId"]},"example":{"threadId":"00000000-0000-0000-0000-000000000000","playbookId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"playbook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["meeting","whatsapp","livechat","flows"]}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"key":{"type":"string","maxLength":40,"pattern":"^[a-z0-9_-]*$"},"title":{"type":"string","minLength":1,"maxLength":120},"objective":{"default":"","type":"string","maxLength":600},"talkTrack":{"default":"","type":"string","maxLength":6000},"watchOut":{"default":"","type":"string","maxLength":600},"questions":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":300}},"required":["id","text"],"additionalProperties":false}}},"required":["id","title","objective","talkTrack","watchOut","questions"],"additionalProperties":false}},"tones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"when":{"type":"string"},"delivery":{"type":"string"}},"required":["id","name","when","delivery"],"additionalProperties":false}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]}},"required":["id","terms","title","text","tone"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}},"guardrails":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","scopes","stages","tones","keywords","attachments","guardrails","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"progress":{"anyOf":[{"type":"object","properties":{"stageId":{"type":["string","null"]},"coveredQuestionIds":{"type":"array","items":{"type":"string"}}},"required":["stageId","coveredQuestionIds"],"additionalProperties":false},{"type":"null"}]},"source":{"anyOf":[{"type":"string","enum":["thread","pipeline"]},{"type":"null"}]}},"required":["playbook","progress","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.simulate":{"post":{"operationId":"playbooks.simulate","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.simulate.md"},"x-mcp-tool":"playbooks_simulate","x-cli":"node cli/atomiks.mjs playbooks.simulate --json '{...}'","x-session-only":false,"summary":"Simular o copiloto do playbook (IA)","description":"Aba Testar do editor: dada a conversa simulada (`turns`, até 40 falas, `host` = vendedor e `guest` = cliente), a ficha (`briefing`: objetivo, perfil, fatos, roteiro, proteções) e o que já foi sugerido, a Atom decide se sopra algo ao vendedor agora. Devolve `{suggest: true, title?, text, tone}` (`tone`: info, warning ou urgent) ou `{suggest: false, reason?}` (silêncio). `reason` é o motivo do acionamento (`question` ou `signal`). `agentId` é aceito por compatibilidade e ainda não muda a resposta. Roda no servidor com o modelo claude-haiku-5-5; sem a variável ANTHROPIC_API_KEY responde `credencial_ausente` (503).","x-scope":"crm:write","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"agentId":{"type":"string","maxLength":100},"turns":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["host","guest"]},"name":{"type":"string","maxLength":80},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","text"]}},"reason":{"type":"string","minLength":1,"maxLength":40},"briefing":{"type":"object","properties":{"goal":{"type":"string","maxLength":400},"persona":{"type":"string","maxLength":1000},"facts":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":80},"value":{"type":"string","maxLength":400}},"required":["label","value"]}},"script":{"type":"string","maxLength":12000},"guardrails":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":300}},"timezone":{"type":"string","maxLength":64}}},"alreadySuggested":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":500}},"locale":{"type":"string","maxLength":20}},"required":["turns"]},"example":{"turns":[{"role":"guest","text":"Achei o valor alto, vou pensar."}],"reason":"signal","locale":"pt-BR"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"suggest":{"type":"boolean"},"title":{"type":"string"},"text":{"type":"string"},"tone":{"type":"string","enum":["info","warning","urgent"]},"reason":{"type":"string"}},"required":["suggest"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.transcribe_audio":{"post":{"operationId":"playbooks.transcribe_audio","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.transcribe_audio.md"},"x-mcp-tool":"playbooks_transcribe_audio","x-cli":"node cli/atomiks.mjs playbooks.transcribe_audio --json '{...}'","x-session-only":false,"summary":"Transcrever áudio do simulador","description":"Transcreve a fala gravada no simulador. `audio` é o arquivo em base64 (até 20 MB), `format` a extensão (webm, m4a, mp4, ogg, oga, wav, mp3, mpeg, mpga, flac) e `language` o idioma de 2 letras (opcional). Devolve `{text}` (vazio se não entendeu). Provedor escolhido por TRANSCRIBE_PROVIDER (`openai` padrão, ou `groq`) com OPENAI_API_KEY ou GROQ_API_KEY; sem a chave responde `credencial_ausente` (503).","x-scope":"crm:write","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"audio":{"type":"string","minLength":1,"maxLength":30000000},"format":{"type":"string","enum":["webm","m4a","mp4","ogg","oga","wav","mp3","mpeg","mpga","flac"]},"language":{"type":"string","pattern":"^[a-z]{2,3}$"}},"required":["audio","format"]},"example":{"audio":"UklGRg==","format":"webm","language":"pt"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string"}},"required":["text"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/playbooks.attachment_upload":{"post":{"operationId":"playbooks.attachment_upload","tags":["playbooks"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/playbooks.attachment_upload.md"},"x-mcp-tool":"playbooks_attachment_upload","x-cli":"node cli/atomiks.mjs playbooks.attachment_upload --json '{...}'","x-session-only":false,"summary":"Enviar anexo de apoio do playbook","description":"Guarda um arquivo (até 10 MB) para ser anexo de um playbook e devolve o item pronto para a lista `attachments` de `playbooks.create`/`playbooks.update` ({id, name, url, mimeType, size}). `content` é o arquivo em base64; `mimeType` aceita PDF, imagens (PNG, JPEG, WebP, GIF), TXT, CSV e documentos do Office. O `url` é `/api/v1/playbook-files/<id>` (GET com sessão ou chave `crm:read`, responde 302 para um link assinado de 60 s). Enviar não anexa: o arquivo só passa a fazer parte do playbook quando o item entra em `attachments` e o playbook é salvo.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","minLength":1,"maxLength":14000000}},"required":["name","mimeType","content"]},"example":{"name":"precos.pdf","mimeType":"application/pdf","content":"JVBERi0xLjQK"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","name","url","mimeType","size"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.list":{"post":{"operationId":"cadences.list","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.list.md"},"x-mcp-tool":"cadences_list","x-cli":"node cli/atomiks.mjs cadences.list --json '{...}'","x-session-only":false,"summary":"Listar cadências de follow-up","description":"Cadências da conta, da mais antiga à mais nova. Cada uma traz os passos planos (`steps`: `position` e `phase` a partir de 1, `type` call/whatsapp/meeting/task, `priority`, `waitMinutes` depois do passo anterior, título e orientação), `phaseNames`, a etapa que a dispara (`stageId`/`stageName`; nulo = avulsa, só aplicada à mão), calendário de atendimento, limite diário por atendente e `liveRuns` (oportunidades em andamento). Sem a migration, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"stageId":{"type":["string","null"]},"stageName":{"type":["string","null"]},"businessHoursCalendarId":{"type":["string","null"]},"dailyLimitPerAttendant":{"type":["number","null"]},"phaseNames":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"phase":{"type":"number"},"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"number"},"durationMinutes":{"type":["number","null"]},"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["position","phase","type","priority","waitMinutes","durationMinutes","title","description"],"additionalProperties":false}},"liveRuns":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","isActive","stageId","stageName","businessHoursCalendarId","dailyLimitPerAttendant","phaseNames","steps","liveRuns","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.create":{"post":{"operationId":"cadences.create","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.create.md"},"x-mcp-tool":"cadences_create","x-cli":"node cli/atomiks.mjs cadences.create --json '{...}'","x-session-only":false,"summary":"Criar cadência de follow-up","description":"Cria a cadência em `phases` (1 a 10 fases, até 20 passos no total, cada fase com ao menos um passo; passo = `type`, `priority`, `waitMinutes` 0 a 129600, `title`, `description` até 2000 caracteres, `durationMinutes` 5 a 1440). Cada passo vira uma tarefa quando chega a vez. Deu certo -> pula para a próxima fase (na última, conclui); sem sucesso -> segue para o próximo passo (no fim, esgota). `stageId` (etapa aberta) inicia a cadência sozinha quando a oportunidade entra nela e tira a etapa de outra cadência que a usava. `businessHoursCalendarId` empurra prazos para o horário de atendimento (sem ele vale o calendário principal). `dailyLimitPerAttendant` (1 a 500) passa o passo para o dia seguinte quando o atendente atinge o limite. Começa ativa.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"isActive":{"type":"boolean"},"stageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"businessHoursCalendarId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dailyLimitPerAttendant":{"anyOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]},"phases":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"steps":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"default":"none","type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"integer","minimum":0,"maximum":129600},"durationMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["type","waitMinutes","title"]}}},"required":["steps"]}}},"required":["name","phases"]},"example":{"name":"Reativação de lead frio","phases":[{"name":"Retomada","steps":[{"type":"whatsapp","priority":"none","waitMinutes":0,"title":"Retomar a conversa com uma novidade"},{"type":"call","priority":"high","waitMinutes":1440,"title":"Ligar para entender o momento"}]}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"stageId":{"type":["string","null"]},"stageName":{"type":["string","null"]},"businessHoursCalendarId":{"type":["string","null"]},"dailyLimitPerAttendant":{"type":["number","null"]},"phaseNames":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"phase":{"type":"number"},"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"number"},"durationMinutes":{"type":["number","null"]},"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["position","phase","type","priority","waitMinutes","durationMinutes","title","description"],"additionalProperties":false}},"liveRuns":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","isActive","stageId","stageName","businessHoursCalendarId","dailyLimitPerAttendant","phaseNames","steps","liveRuns","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.update":{"post":{"operationId":"cadences.update","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.update.md"},"x-mcp-tool":"cadences_update","x-cli":"node cli/atomiks.mjs cadences.update --json '{...}'","x-session-only":false,"summary":"Editar cadência de follow-up","description":"Altera a cadência. Só o que for enviado muda; `phases` substitui todos os passos. Execuções em andamento seguem pelo número do passo (passo removido conta como fim da lista). `stageId`, `businessHoursCalendarId`, `dailyLimitPerAttendant` e `description` aceitam null para limpar. Mesmas regras de `cadences.create`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"isActive":{"type":"boolean"},"stageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"businessHoursCalendarId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dailyLimitPerAttendant":{"anyOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]},"phases":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"steps":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"default":"none","type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"integer","minimum":0,"maximum":129600},"durationMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["type","waitMinutes","title"]}}},"required":["steps"]}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Reativação","isActive":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"stageId":{"type":["string","null"]},"stageName":{"type":["string","null"]},"businessHoursCalendarId":{"type":["string","null"]},"dailyLimitPerAttendant":{"type":["number","null"]},"phaseNames":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"phase":{"type":"number"},"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"number"},"durationMinutes":{"type":["number","null"]},"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["position","phase","type","priority","waitMinutes","durationMinutes","title","description"],"additionalProperties":false}},"liveRuns":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","isActive","stageId","stageName","businessHoursCalendarId","dailyLimitPerAttendant","phaseNames","steps","liveRuns","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.delete":{"post":{"operationId":"cadences.delete","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.delete.md"},"x-mcp-tool":"cadences_delete","x-cli":"node cli/atomiks.mjs cadences.delete --json '{...}'","x-session-only":false,"summary":"Excluir cadência de follow-up","description":"Exclui a cadência e o histórico das oportunidades que passaram por ela (execuções e painel). As tarefas já criadas continuam na agenda. Para só parar de usar, desative com `cadences.set_active`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.set_active":{"post":{"operationId":"cadences.set_active","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.set_active.md"},"x-mcp-tool":"cadences_set_active","x-cli":"node cli/atomiks.mjs cadences.set_active --json '{...}'","x-session-only":false,"summary":"Ativar ou desativar cadência","description":"Cadência desativada não pode ser aplicada nem inicia sozinha pela etapa; as execuções em andamento continuam. Devolve a cadência.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"isActive":{"type":"boolean"}},"required":["id","isActive"]},"example":{"id":"00000000-0000-0000-0000-000000000000","isActive":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"stageId":{"type":["string","null"]},"stageName":{"type":["string","null"]},"businessHoursCalendarId":{"type":["string","null"]},"dailyLimitPerAttendant":{"type":["number","null"]},"phaseNames":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"phase":{"type":"number"},"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"number"},"durationMinutes":{"type":["number","null"]},"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["position","phase","type","priority","waitMinutes","durationMinutes","title","description"],"additionalProperties":false}},"liveRuns":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","isActive","stageId","stageName","businessHoursCalendarId","dailyLimitPerAttendant","phaseNames","steps","liveRuns","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.set_stage":{"post":{"operationId":"cadences.set_stage","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.set_stage.md"},"x-mcp-tool":"cadences_set_stage","x-cli":"node cli/atomiks.mjs cadences.set_stage --json '{...}'","x-session-only":false,"summary":"Vincular cadência a uma etapa","description":"A cadência passa a começar sozinha quando a oportunidade entra na etapa (`stageId`, etapa aberta). `null` desvincula (avulsa). Cada etapa tem uma cadência: a que já estava nela deixa de começar ali. Devolve a cadência.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","stageId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"stageId":{"type":["string","null"]},"stageName":{"type":["string","null"]},"businessHoursCalendarId":{"type":["string","null"]},"dailyLimitPerAttendant":{"type":["number","null"]},"phaseNames":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"phase":{"type":"number"},"type":{"type":"string","enum":["call","whatsapp","meeting","task"]},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"waitMinutes":{"type":"number"},"durationMinutes":{"type":["number","null"]},"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["position","phase","type","priority","waitMinutes","durationMinutes","title","description"],"additionalProperties":false}},"liveRuns":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","isActive","stageId","stageName","businessHoursCalendarId","dailyLimitPerAttendant","phaseNames","steps","liveRuns","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.stats":{"post":{"operationId":"cadences.stats","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.stats.md"},"x-mcp-tool":"cadences_stats","x-cli":"node cli/atomiks.mjs cadences.stats --json '{...}'","x-session-only":false,"summary":"Painel de uma cadência","description":"Números desde a criação: execuções por situação (`runs`; `successRate` = concluídas / (concluídas + esgotadas), `avgHoursToComplete` da aplicação à conclusão), encerradas por motivo (`won`, `lost`, `removed`, `stage_changed`, `other`), uma linha por passo (`generated`, `resolved`, `positive`, `negative`, `noOutcome`, `open`, `overdue`, `currentRuns`, `avgHoursToResolve`; passo removido da cadência aparece só no histórico), os últimos 30 dias (`daily`, no fuso da conta) e por atendente.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"runs":{"type":"object","properties":{"total":{"type":"number"},"active":{"type":"number"},"paused":{"type":"number"},"completed":{"type":"number"},"exhausted":{"type":"number"},"stopped":{"type":"number"},"successRate":{"type":["number","null"]},"avgHoursToComplete":{"type":["number","null"]}},"required":["total","active","paused","completed","exhausted","stopped","successRate","avgHoursToComplete"],"additionalProperties":false},"stoppedByReason":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"],"additionalProperties":false}},"steps":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"generated":{"type":"number"},"resolved":{"type":"number"},"positive":{"type":"number"},"negative":{"type":"number"},"noOutcome":{"type":"number"},"open":{"type":"number"},"overdue":{"type":"number"},"cancelled":{"type":"number"},"avgHoursToResolve":{"type":["number","null"]},"currentRuns":{"type":"number"}},"required":["position","generated","resolved","positive","negative","noOutcome","open","overdue","cancelled","avgHoursToResolve","currentRuns"],"additionalProperties":false}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"started":{"type":"number"},"completed":{"type":"number"},"exhausted":{"type":"number"}},"required":["day","started","completed","exhausted"],"additionalProperties":false}},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":["string","null"]},"name":{"type":["string","null"]},"generated":{"type":"number"},"resolved":{"type":"number"},"positive":{"type":"number"},"negative":{"type":"number"},"noOutcome":{"type":"number"},"open":{"type":"number"},"overdue":{"type":"number"},"cancelled":{"type":"number"},"avgHoursToResolve":{"type":["number","null"]}},"required":["attendantId","name","generated","resolved","positive","negative","noOutcome","open","overdue","cancelled","avgHoursToResolve"],"additionalProperties":false}}},"required":["runs","stoppedByReason","steps","daily","attendants"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.runs_list":{"post":{"operationId":"cadences.runs_list","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.runs_list.md"},"x-mcp-tool":"cadences_runs_list","x-cli":"node cli/atomiks.mjs cadences.runs_list --json '{...}'","x-session-only":false,"summary":"Cadências de uma oportunidade","description":"Execuções da oportunidade, da mais recente à mais antiga (`opportunityId` é o id do card). `status`: `active` (em andamento), `paused` (pausada: `statusReason` `existing_next_action` = a oportunidade já tinha outra próxima ação aberta), `completed` (deu certo na última fase), `exhausted` (todos os passos sem resultado positivo), `stopped` (`statusReason`: `won`, `lost`, `removed`, `stage_changed`). Traz fase e passo atuais, a próxima ação (`currentTaskTitle`, `currentTaskStatus`, `nextAt`) e as datas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["opportunityId"]},"example":{"opportunityId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cadenceId":{"type":"string"},"cadenceName":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","exhausted","stopped"]},"statusReason":{"type":["string","null"]},"phase":{"type":["number","null"]},"phaseName":{"type":["string","null"]},"totalPhases":{"type":"number"},"phaseStep":{"type":"number"},"phaseSteps":{"type":"number"},"currentPosition":{"type":"number"},"totalSteps":{"type":"number"},"currentTaskId":{"type":["string","null"]},"currentTaskTitle":{"type":["string","null"]},"currentTaskStatus":{"anyOf":[{"type":"string","enum":["open","done"]},{"type":"null"}]},"nextAt":{"type":["string","null"]},"automatic":{"type":"boolean"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","cadenceId","cadenceName","opportunityId","status","statusReason","phase","phaseName","totalPhases","phaseStep","phaseSteps","currentPosition","totalSteps","currentTaskId","currentTaskTitle","currentTaskStatus","nextAt","automatic","startedAt","finishedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.runs_start":{"post":{"operationId":"cadences.runs_start","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.runs_start.md"},"x-mcp-tool":"cadences_runs_start","x-cli":"node cli/atomiks.mjs cadences.runs_start --json '{...}'","x-session-only":false,"summary":"Aplicar cadência a uma oportunidade","description":"Inicia a cadência (ativa) na oportunidade aberta e cria a tarefa do passo 1 na hora (mesmo que a oportunidade já tenha outra próxima ação aberta). Responsável da tarefa: o dono da oportunidade, ou quem aplicou. Oportunidade que já está em uma cadência (ativa ou pausada) dá `limit_reached` (409): tire-a da atual antes.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cadenceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["cadenceId","opportunityId"]},"example":{"cadenceId":"00000000-0000-0000-0000-000000000000","opportunityId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"cadenceId":{"type":"string"},"cadenceName":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","exhausted","stopped"]},"statusReason":{"type":["string","null"]},"phase":{"type":["number","null"]},"phaseName":{"type":["string","null"]},"totalPhases":{"type":"number"},"phaseStep":{"type":"number"},"phaseSteps":{"type":"number"},"currentPosition":{"type":"number"},"totalSteps":{"type":"number"},"currentTaskId":{"type":["string","null"]},"currentTaskTitle":{"type":["string","null"]},"currentTaskStatus":{"anyOf":[{"type":"string","enum":["open","done"]},{"type":"null"}]},"nextAt":{"type":["string","null"]},"automatic":{"type":"boolean"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","cadenceId","cadenceName","opportunityId","status","statusReason","phase","phaseName","totalPhases","phaseStep","phaseSteps","currentPosition","totalSteps","currentTaskId","currentTaskTitle","currentTaskStatus","nextAt","automatic","startedAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.runs_stop":{"post":{"operationId":"cadences.runs_stop","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.runs_stop.md"},"x-mcp-tool":"cadences_runs_stop","x-cli":"node cli/atomiks.mjs cadences.runs_stop --json '{...}'","x-session-only":false,"summary":"Tirar a oportunidade da cadência","description":"Encerra a execução (`stopped`, motivo `removed`). As tarefas já criadas continuam na agenda; a cadência só para de criar as próximas. Execução já encerrada é devolvida como está.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"cadenceId":{"type":"string"},"cadenceName":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","exhausted","stopped"]},"statusReason":{"type":["string","null"]},"phase":{"type":["number","null"]},"phaseName":{"type":["string","null"]},"totalPhases":{"type":"number"},"phaseStep":{"type":"number"},"phaseSteps":{"type":"number"},"currentPosition":{"type":"number"},"totalSteps":{"type":"number"},"currentTaskId":{"type":["string","null"]},"currentTaskTitle":{"type":["string","null"]},"currentTaskStatus":{"anyOf":[{"type":"string","enum":["open","done"]},{"type":"null"}]},"nextAt":{"type":["string","null"]},"automatic":{"type":"boolean"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","cadenceId","cadenceName","opportunityId","status","statusReason","phase","phaseName","totalPhases","phaseStep","phaseSteps","currentPosition","totalSteps","currentTaskId","currentTaskTitle","currentTaskStatus","nextAt","automatic","startedAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.runs_resume":{"post":{"operationId":"cadences.runs_resume","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.runs_resume.md"},"x-mcp-tool":"cadences_runs_resume","x-cli":"node cli/atomiks.mjs cadences.runs_resume --json '{...}'","x-session-only":false,"summary":"Retomar cadência pausada","description":"Cria a tarefa do passo em que a execução parou e a deixa em andamento. Vale para a pausada e para a ativa cujo passo atual não tem mais tarefa aberta; ativa com tarefa aberta dá `invalid_input`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"cadenceId":{"type":"string"},"cadenceName":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","exhausted","stopped"]},"statusReason":{"type":["string","null"]},"phase":{"type":["number","null"]},"phaseName":{"type":["string","null"]},"totalPhases":{"type":"number"},"phaseStep":{"type":"number"},"phaseSteps":{"type":"number"},"currentPosition":{"type":"number"},"totalSteps":{"type":"number"},"currentTaskId":{"type":["string","null"]},"currentTaskTitle":{"type":["string","null"]},"currentTaskStatus":{"anyOf":[{"type":"string","enum":["open","done"]},{"type":"null"}]},"nextAt":{"type":["string","null"]},"automatic":{"type":"boolean"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","cadenceId","cadenceName","opportunityId","status","statusReason","phase","phaseName","totalPhases","phaseStep","phaseSteps","currentPosition","totalSteps","currentTaskId","currentTaskTitle","currentTaskStatus","nextAt","automatic","startedAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.runs_advance":{"post":{"operationId":"cadences.runs_advance","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.runs_advance.md"},"x-mcp-tool":"cadences_runs_advance","x-cli":"node cli/atomiks.mjs cadences.runs_advance --json '{...}'","x-session-only":false,"summary":"Registrar o resultado do passo e gerar a próxima ação","description":"Conclui a tarefa do passo atual com `outcome` (`positive` = deu certo; `negative` ou `none` = sem sucesso) e faz o que a cadência manda: deu certo pula para a primeira etapa da próxima fase (na última fase, a execução fica `completed`); sem sucesso cria a tarefa do próximo passo (sem próximo, fica `exhausted`). Se a oportunidade já tem outra próxima ação aberta, a execução fica `paused` (`existing_next_action`) até `cadences.runs_resume`. Só execução `active`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"outcome":{"type":"string","enum":["positive","negative","none"]}},"required":["id","outcome"]},"example":{"id":"00000000-0000-0000-0000-000000000000","outcome":"negative"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"cadenceId":{"type":"string"},"cadenceName":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","exhausted","stopped"]},"statusReason":{"type":["string","null"]},"phase":{"type":["number","null"]},"phaseName":{"type":["string","null"]},"totalPhases":{"type":"number"},"phaseStep":{"type":"number"},"phaseSteps":{"type":"number"},"currentPosition":{"type":"number"},"totalSteps":{"type":"number"},"currentTaskId":{"type":["string","null"]},"currentTaskTitle":{"type":["string","null"]},"currentTaskStatus":{"anyOf":[{"type":"string","enum":["open","done"]},{"type":"null"}]},"nextAt":{"type":["string","null"]},"automatic":{"type":"boolean"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","cadenceId","cadenceName","opportunityId","status","statusReason","phase","phaseName","totalPhases","phaseStep","phaseSteps","currentPosition","totalSteps","currentTaskId","currentTaskTitle","currentTaskStatus","nextAt","automatic","startedAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cadences.tasks_create":{"post":{"operationId":"cadences.tasks_create","tags":["cadences"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/cadences.tasks_create.md"},"x-mcp-tool":"cadences_tasks_create","x-cli":"node cli/atomiks.mjs cadences.tasks_create --json '{...}'","x-session-only":false,"summary":"Criar uma sequência de tarefas para uma oportunidade","description":"Cadência avulsa do \"novo item de agenda\": cria uma tarefa por passo (`steps`, 1 a 20), com o prazo de cada uma contado da anterior (`waitMinutes` acumulado a partir de agora; o primeiro passo conta a partir do momento da chamada). `type` `whatsapp` vira tarefa de mensagem. `attendantId` (padrão: o dono da oportunidade, ou quem chamou) precisa ver o contato. O texto de `automation.message` entra nas anotações da tarefa como mensagem planejada: o Atomiks ainda não envia essa mensagem sozinho nem para ao receber resposta. Não usa execução de cadência (não aparece em `cadences.runs_list`). Devolve as tarefas criadas.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"steps":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"waitMinutes":{"type":"integer","minimum":0,"maximum":129600},"title":{"type":"string","minLength":1,"maxLength":200},"type":{"default":"whatsapp","type":"string","enum":["call","whatsapp","meeting","task"]},"description":{"type":"string","maxLength":2000},"durationMinutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]},"automation":{"type":"object","properties":{"channel":{"type":"string","const":"whatsapp"},"channelInstanceId":{"type":"string","maxLength":100},"templateId":{"type":"string","maxLength":200},"templateParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"message":{"type":"string","maxLength":5000},"stopOnReply":{"type":"boolean"}}}},"required":["waitMinutes","title"]}}},"required":["opportunityId","steps"]},"example":{"opportunityId":"00000000-0000-0000-0000-000000000000","steps":[{"waitMinutes":0,"title":"Mandar apresentação","type":"whatsapp","automation":{"message":"Olá! Tudo bem?"}}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"dueAt":{"type":"string"}},"required":["id","title","kind","dueAt"],"additionalProperties":false}}},"required":["tasks"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.list":{"post":{"operationId":"connections.list","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.list.md"},"x-mcp-tool":"connections_list","x-cli":"node cli/atomiks.mjs connections.list --json '{...}'","x-session-only":false,"summary":"Listar as conexões do Google","description":"Conexões ativas de Google Calendar (`provider: google`, agendamentos e links do Google Meet) e Google Drive (`google_drive`) dos atendentes. Sem `attendantId` vêm as da conta toda; com ele, só as daquele atendente. `canWrite` (Drive) = autorizou escrita. `calendars` traz os calendários do Google Calendar e se cada um bloqueia horários (`selected`). `available` = o servidor tem `GOOGLE_CLIENT_ID` e `GOOGLE_CLIENT_SECRET` (sem eles `connections.google_authorize` responde `credencial_ausente`). Nunca devolve tokens. Microsoft Teams está \"em breve\" no original e não tem operação. Sem a migration a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"available":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"attendantId":{"type":"string"},"attendantName":{"type":"string"},"provider":{"type":"string","enum":["google","google_drive"]},"email":{"type":["string","null"]},"canWrite":{"type":"boolean"},"connectedAt":{"type":"string"},"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","const":"google"},"calendarId":{"type":"string"},"name":{"type":["string","null"]},"primary":{"type":"boolean"},"selected":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["id","provider","calendarId","name","primary","selected","email"],"additionalProperties":false}}},"required":["id","attendantId","attendantName","provider","email","canWrite","connectedAt","calendars"],"additionalProperties":false}}},"required":["available","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_authorize":{"post":{"operationId":"connections.google_authorize","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_authorize.md"},"x-mcp-tool":"connections_google_authorize","x-cli":"node cli/atomiks.mjs connections.google_authorize --json '{...}'","x-session-only":false,"summary":"Gerar a URL para conectar o Google","description":"Devolve `url`: a tela de consentimento do Google (escopos de Calendar/Meet com `provider: google`, ou de Drive com `google_drive`; `access: write` pede escrita no Drive). Abra a `url` no navegador; o Google volta para `/api/integrations/google/callback`, que grava a conexão e redireciona para `returnTo` (só a própria aplicação; padrão a tela de Conexões) com `?calendar_integration=google_success|google_error` ou `?drive_integration=google_drive_success|google_drive_error` e, no erro, `reason` (`state_expired`, `missing_refresh_token`, `access_denied`, `token_exchange_failed`, `persist_failed`, `callback_failed`, `unknown`). O link vale 10 minutos. `attendantId` conecta em nome de outro atendente (só administrador). Sem `GOOGLE_CLIENT_ID`/`GOOGLE_CLIENT_SECRET` responde `credencial_ausente`; sem a migration, `migration_pendente`.","x-scope":"crm:write","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"provider":{"default":"google","type":"string","enum":["google","google_drive"]},"returnTo":{"type":"string","maxLength":2000},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"access":{"type":"string","enum":["read","write"]}}},"example":{"provider":"google","returnTo":"https://app.atomiks.example/comercial/configuracoes-crm/conexoes"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.disconnect":{"post":{"operationId":"connections.disconnect","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.disconnect.md"},"x-mcp-tool":"connections_disconnect","x-cli":"node cli/atomiks.mjs connections.disconnect --json '{...}'","x-session-only":false,"summary":"Desconectar o Google de um atendente","description":"Revoga o acesso no Google (melhor esforço) e apaga a conexão (`id` de `connections.list`) com os calendários guardados. O próprio atendente ou um administrador. As agendas que usavam os calendários deixam de bloqueá-los.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_calendars":{"post":{"operationId":"connections.google_calendars","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_calendars.md"},"x-mcp-tool":"connections_google_calendars","x-cli":"node cli/atomiks.mjs connections.google_calendars --json '{...}'","x-session-only":false,"summary":"Ver os calendários do Google de um atendente","description":"Calendários do Google Calendar do atendente (`id` é o que as agendas guardam em `externalCalendarIds`; `calendarId` é o id no Google, o e-mail no principal; `selected` = bloqueia horários). `connected: false` = ainda não conectou. Qualquer membro lê; `refresh: true` pede ao Google a lista de novo (só o próprio atendente ou administrador). Mesmo formato de `attendants.calendars_get`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"refresh":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string"},"name":{"type":"string"},"connected":{"type":"boolean"},"externalCalendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","const":"google"},"calendarId":{"type":"string"},"name":{"type":["string","null"]},"primary":{"type":"boolean"},"selected":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["id","provider","calendarId","name","primary","selected","email"],"additionalProperties":false}}},"required":["attendantId","name","connected","externalCalendars"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_calendars_select":{"post":{"operationId":"connections.google_calendars_select","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_calendars_select.md"},"x-mcp-tool":"connections_google_calendars_select","x-cli":"node cli/atomiks.mjs connections.google_calendars_select --json '{...}'","x-session-only":false,"summary":"Escolher quais calendários bloqueiam horários","description":"Define os calendários do Google (`id` de `connections.google_calendars`) que contam como horário ocupado do atendente: os de `selectedIds` ficam marcados e os demais, não. O próprio atendente ou um administrador. Devolve a lista nova.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"selectedIds":{"maxItems":250,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["selectedIds"]},"example":{"selectedIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string"},"name":{"type":"string"},"connected":{"type":"boolean"},"externalCalendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","const":"google"},"calendarId":{"type":"string"},"name":{"type":["string","null"]},"primary":{"type":"boolean"},"selected":{"type":"boolean"},"email":{"type":["string","null"]}},"required":["id","provider","calendarId","name","primary","selected","email"],"additionalProperties":false}}},"required":["attendantId","name","connected","externalCalendars"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_events":{"post":{"operationId":"connections.google_events","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_events.md"},"x-mcp-tool":"connections_google_events","x-cli":"node cli/atomiks.mjs connections.google_events --json '{...}'","x-session-only":false,"summary":"Ver os eventos ocupados do Google Calendar","description":"Eventos do atendente entre `from` e `to` (ISO 8601) nos calendários marcados (`selected`): `externalId`, `startAt`, `endAt`, `title`. Fora cancelados, os marcados como \"livre\" e os recusados. Sem conexão (ou conexão expirada) vem vazio. O próprio atendente ou um administrador; até 366 dias.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["from","to"]},"example":{"from":"2026-11-02T00:00:00-03:00","to":"2026-11-03T00:00:00-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"startAt":{"type":"string"},"endAt":{"type":"string"},"title":{"type":"string"}},"required":["externalId","startAt","endAt","title"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_event_create":{"post":{"operationId":"connections.google_event_create","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_event_create.md"},"x-mcp-tool":"connections_google_event_create","x-cli":"node cli/atomiks.mjs connections.google_event_create --json '{...}'","x-session-only":false,"summary":"Criar evento no Google Calendar (com link do Meet)","description":"Cria o evento no calendário do atendente (`calendarId`, padrão `primary`) e, por padrão (`withMeet`, padrão true), gera o link do Google Meet: `meetUrl`. `attendeeEmails` convida pessoas; `notifyAttendees` manda o convite do Google. É o que as agendas usam ao marcar uma reunião. O próprio atendente ou um administrador. Sem conexão, `not_found`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"calendarId":{"type":"string","minLength":1,"maxLength":500},"title":{"type":"string","minLength":1,"maxLength":300},"description":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}]},"location":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"timeZone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"attendeeEmails":{"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"notifyAttendees":{"type":"boolean"},"withMeet":{"type":"boolean"}},"required":["title","startAt","endAt"]},"example":{"title":"Reunião de apresentação","startAt":"2026-11-02T14:00:00-03:00","endAt":"2026-11-02T14:30:00-03:00","attendeeEmails":["cliente@exemplo.com"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventId":{"type":"string"},"calendarId":{"type":"string"},"htmlLink":{"type":["string","null"]},"meetUrl":{"type":["string","null"]},"status":{"type":"string"}},"required":["eventId","calendarId","htmlLink","meetUrl","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_event_update":{"post":{"operationId":"connections.google_event_update","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_event_update.md"},"x-mcp-tool":"connections_google_event_update","x-cli":"node cli/atomiks.mjs connections.google_event_update --json '{...}'","x-session-only":false,"summary":"Alterar evento do Google Calendar","description":"Altera só o que vier (`title`, `description`, `location`, `startAt`/`endAt`, `attendeeEmails`). `withMeet: true` acrescenta o link do Meet se o evento ainda não tiver. Use o `eventId` e o `calendarId` de `connections.google_event_create`. O próprio atendente ou um administrador.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"calendarId":{"type":"string","minLength":1,"maxLength":500},"eventId":{"type":"string","minLength":1,"maxLength":200},"withMeet":{"type":"boolean"},"title":{"type":"string","minLength":1,"maxLength":300},"description":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}]},"location":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"startAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"timeZone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"attendeeEmails":{"maxItems":50,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"notifyAttendees":{"type":"boolean"}},"required":["eventId"]},"example":{"eventId":"abc123","startAt":"2026-11-02T15:00:00-03:00","endAt":"2026-11-02T15:30:00-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventId":{"type":"string"},"calendarId":{"type":"string"},"htmlLink":{"type":["string","null"]},"meetUrl":{"type":["string","null"]},"status":{"type":"string"}},"required":["eventId","calendarId","htmlLink","meetUrl","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_event_cancel":{"post":{"operationId":"connections.google_event_cancel","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_event_cancel.md"},"x-mcp-tool":"connections_google_event_cancel","x-cli":"node cli/atomiks.mjs connections.google_event_cancel --json '{...}'","x-session-only":false,"summary":"Cancelar evento do Google Calendar","description":"Apaga o evento do calendário (`notifyAttendees` avisa os convidados). Evento que já não existe conta como cancelado. O próprio atendente ou um administrador.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"calendarId":{"type":"string","minLength":1,"maxLength":500},"eventId":{"type":"string","minLength":1,"maxLength":200},"notifyAttendees":{"type":"boolean"}},"required":["eventId"]},"example":{"eventId":"abc123"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventId":{"type":"string"}},"required":["eventId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/connections.google_drive_files":{"post":{"operationId":"connections.google_drive_files","tags":["connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/connections.google_drive_files.md"},"x-mcp-tool":"connections_google_drive_files","x-cli":"node cli/atomiks.mjs connections.google_drive_files --json '{...}'","x-session-only":false,"summary":"Listar arquivos do Google Drive de um atendente","description":"Arquivos do Drive conectado do atendente, do mais recente ao mais antigo: `search` filtra pelo nome, `folderId` lista uma pasta, `nextPageToken` continua (use como `pageToken`). `pageSize` até 100. O próprio atendente ou um administrador. Sem Drive conectado, `not_found`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"search":{"type":"string","maxLength":200},"folderId":{"type":"string","maxLength":200},"pageToken":{"type":"string","maxLength":2000},"pageSize":{"type":"integer","minimum":1,"maximum":100}}},"example":{"search":"proposta"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mimeType":{"type":"string"},"webViewLink":{"type":["string","null"]},"iconLink":{"type":["string","null"]},"modifiedTime":{"type":["string","null"]},"size":{"type":["number","null"]}},"required":["id","name","mimeType","webViewLink","iconLink","modifiedTime","size"],"additionalProperties":false}},"nextPageToken":{"type":["string","null"]}},"required":["items","nextPageToken"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.list":{"post":{"operationId":"ai_agents.list","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.list.md"},"x-mcp-tool":"ai_agents_list","x-cli":"node cli/atomiks.mjs ai_agents.list --json '{...}'","x-session-only":false,"summary":"Listar agentes de IA","description":"Agentes de IA da conta (sem os excluídos), do mais antigo ao mais novo, em páginas (`page` a partir de 1, `perPage` até 100, padrão 48). Cada agente traz nome, objetivo (`purpose`), rosto (`avatarPreset`, chave de um rosto pronto, ou `avatarUrl`), `status` (`draft`, `active`, `paused`), provedor, `credentialId`, modelo, temperatura (0 a 1), persona, ferramentas, regras de escalonamento, `primaryRole`, versão publicada, `dirty` (há alterações não publicadas) e os contadores de conversas. Sem a migration, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"default":48,"type":"integer","minimum":1,"maximum":100},"status":{"type":"string","enum":["draft","active","paused"]}}},"example":{"page":1,"perPage":48}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countPages":{"type":"number"},"countItens":{"type":"number"}},"required":["page","perPage","countPages","countItens"],"additionalProperties":false}},"required":["items","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.summary":{"post":{"operationId":"ai_agents.summary","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.summary.md"},"x-mcp-tool":"ai_agents_summary","x-cli":"node cli/atomiks.mjs ai_agents.summary --json '{...}'","x-session-only":false,"summary":"Resumo do time de agentes","description":"Totais do time de agentes: quantos são, quantos ativos, pausados e em rascunho, e a soma de conversas, resolvidas, agendadas e passadas para o time.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"agents":{"type":"number"},"active":{"type":"number"},"paused":{"type":"number"},"draft":{"type":"number"},"conversations":{"type":"number"},"resolved":{"type":"number"},"scheduled":{"type":"number"},"escalated":{"type":"number"}},"required":["agents","active","paused","draft","conversations","resolved","scheduled","escalated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.get":{"post":{"operationId":"ai_agents.get","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.get.md"},"x-mcp-tool":"ai_agents_get","x-cli":"node cli/atomiks.mjs ai_agents.get --json '{...}'","x-session-only":false,"summary":"Ver um agente de IA","description":"Um agente de IA com toda a configuração (mesmo formato de `ai_agents.list`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.providers":{"post":{"operationId":"ai_agents.providers","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.providers.md"},"x-mcp-tool":"ai_agents_providers","x-cli":"node cli/atomiks.mjs ai_agents.providers --json '{...}'","x-session-only":false,"summary":"Provedores e modelos de IA","description":"Provedores de IA aceitos (`openai`, `anthropic`) e os modelos de cada um, com o nível (`fast`, `balanced`, `best`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic"]},"name":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string"}},"required":["id","name","tier"],"additionalProperties":false}}},"required":["provider","name","models"],"additionalProperties":false}}},"required":["providers"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.create":{"post":{"operationId":"ai_agents.create","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.create.md"},"x-mcp-tool":"ai_agents_create","x-cli":"node cli/atomiks.mjs ai_agents.create --json '{...}'","x-session-only":false,"summary":"Criar agente de IA","description":"Cria um agente em `draft` (rascunho; precisa de `ai_agents.publish` antes de ativar). `credentialId` é uma chave de `ai_credentials.list` ainda válida e o provedor sai dela. Sem `avatarPreset` nem `avatarUrl` o rosto é escolhido pelo id. Padrões: temperatura 0.4, persona vazia, nenhuma ferramenta, nenhuma regra, `primaryRole` `sdr_inbound`. Exige a migration de agentes (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"credentialId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"avatarPreset":{"anyOf":[{"type":"string","enum":["pedro","ana","fernando","clara","mateus","beatriz","rodrigo","samuel","laura","felipe","alice","joao","henrique","isabela","daniel","yasmin","otavio","manuela","eduardo","lara","gabriel","valentina","cecilia","leo","amanda","theo","leila","murilo","lorena","enzo","priscila","ricardo"]},{"type":"null"}]},"avatarUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"modelId":{"type":"string","minLength":1,"maxLength":120},"temperature":{"default":0.4,"type":"number","minimum":0,"maximum":1},"persona":{"default":"","type":"string","maxLength":12000},"tools":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","enum":["consultar_agenda","agendar_reuniao","registrar_qualificacao","registrar_oportunidade","criar_tarefa","registrar_nota","criar_campo","aplicar_tag","escalar_para_humano","encerrar_conversa"]}},"escalation":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action"]}},"primaryRole":{"default":"sdr_inbound","type":"string","enum":["sdr_inbound","sdr_outbound","support"]}},"required":["name","credentialId","modelId"]},"example":{"name":"Lia","credentialId":"00000000-0000-0000-0000-000000000000","modelId":"gpt-4.1-mini","purpose":"Qualifica quem chega pelo WhatsApp","temperature":0.4,"persona":"","tools":[],"escalation":[],"primaryRole":"sdr_inbound"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.update":{"post":{"operationId":"ai_agents.update","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.update.md"},"x-mcp-tool":"ai_agents_update","x-cli":"node cli/atomiks.mjs ai_agents.update --json '{...}'","x-session-only":false,"summary":"Editar agente de IA","description":"Altera o agente. Só o que for enviado muda; `null` limpa objetivo e rosto. Nome, objetivo e rosto valem na hora; chave (`credentialId`, que também troca o provedor), modelo, temperatura, persona, ferramentas e regras só entram em uso depois de `ai_agents.publish` (`dirty` fica `true` até lá).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"credentialId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"avatarPreset":{"anyOf":[{"type":"string","enum":["pedro","ana","fernando","clara","mateus","beatriz","rodrigo","samuel","laura","felipe","alice","joao","henrique","isabela","daniel","yasmin","otavio","manuela","eduardo","lara","gabriel","valentina","cecilia","leo","amanda","theo","leila","murilo","lorena","enzo","priscila","ricardo"]},{"type":"null"}]},"avatarUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"modelId":{"type":"string","minLength":1,"maxLength":120},"temperature":{"type":"number","minimum":0,"maximum":1},"persona":{"type":"string","maxLength":12000},"tools":{"maxItems":10,"type":"array","items":{"type":"string","enum":["consultar_agenda","agendar_reuniao","registrar_qualificacao","registrar_oportunidade","criar_tarefa","registrar_nota","criar_campo","aplicar_tag","escalar_para_humano","encerrar_conversa"]}},"escalation":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action"]}},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","temperature":0.2}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.publish":{"post":{"operationId":"ai_agents.publish","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.publish.md"},"x-mcp-tool":"ai_agents_publish","x-cli":"node cli/atomiks.mjs ai_agents.publish --json '{...}'","x-session-only":false,"summary":"Publicar alterações do agente","description":"Congela a configuração atual (chave, modelo, temperatura, persona, ferramentas e regras de escalonamento) como a versão em uso: soma 1 à versão, grava `publishedAt` e zera `dirty`. Um rascunho vira `paused` (ative com `ai_agents.status_set`). Regras de escalonamento sem gatilho ou sem ação impedem a publicação. A chave precisa estar válida.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.status_set":{"post":{"operationId":"ai_agents.status_set","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.status_set.md"},"x-mcp-tool":"ai_agents_status_set","x-cli":"node cli/atomiks.mjs ai_agents.status_set --json '{...}'","x-session-only":false,"summary":"Ativar ou pausar agente de IA","description":"Liga (`active`) ou pausa (`paused`) o agente. Agente nunca publicado responde `invalid_input` (publique antes).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["active","paused"]}},"required":["id","status"]},"example":{"id":"00000000-0000-0000-0000-000000000000","status":"active"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":["string","null"]},"name":{"type":"string"},"purpose":{"type":["string","null"]},"avatarPreset":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused"]},"provider":{"type":"string","enum":["openai","anthropic"]},"credentialId":{"type":"string"},"modelId":{"type":"string"},"temperature":{"type":"number"},"persona":{"type":"string"},"tools":{"type":"array","items":{"type":"string"}},"escalation":{"type":"array","items":{"type":"object","properties":{"trigger":{"type":"string","maxLength":300},"action":{"type":"string","maxLength":300},"enabled":{"default":true,"type":"boolean"}},"required":["trigger","action","enabled"],"additionalProperties":false}},"knowledgeStoreId":{"type":["string","null"]},"primaryRole":{"type":"string","enum":["sdr_inbound","sdr_outbound","support"]},"version":{"type":"number"},"publishedAt":{"type":["string","null"]},"dirty":{"type":"boolean"},"conversationsCount":{"type":"number"},"resolvedCount":{"type":"number"},"scheduledCount":{"type":"number"},"escalatedCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","purpose","avatarPreset","avatarUrl","status","provider","credentialId","modelId","temperature","persona","tools","escalation","knowledgeStoreId","primaryRole","version","publishedAt","dirty","conversationsCount","resolvedCount","scheduledCount","escalatedCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_agents.delete":{"post":{"operationId":"ai_agents.delete","tags":["ai_agents"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_agents.delete.md"},"x-mcp-tool":"ai_agents_delete","x-cli":"node cli/atomiks.mjs ai_agents.delete --json '{...}'","x-session-only":false,"summary":"Excluir agente de IA","description":"Tira o agente da lista e o pausa. A chave do provedor continua cadastrada e as conversas ficam registradas (o registro é marcado como excluído, não apagado).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_credentials.list":{"post":{"operationId":"ai_credentials.list","tags":["ai_credentials"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_credentials.list.md"},"x-mcp-tool":"ai_credentials_list","x-cli":"node cli/atomiks.mjs ai_credentials.list --json '{...}'","x-session-only":false,"summary":"Listar chaves de provedor de IA","description":"Chaves de OpenAI e Anthropic cadastradas na conta, da mais antiga à mais nova. Mostra só os 4 últimos dígitos (`keyLast4`), o `label`, o `status` (`active` válida, `invalid`, `revoked` removida) e quando foi validada. O valor da chave nunca é devolvido. Sem a migration, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["openai","anthropic"]},"label":{"type":"string"},"keyLast4":{"type":"string"},"status":{"type":"string","enum":["active","invalid","revoked"]},"lastValidatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","label","keyLast4","status","lastValidatedAt","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_credentials.create":{"post":{"operationId":"ai_credentials.create","tags":["ai_credentials"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_credentials.create.md"},"x-mcp-tool":"ai_credentials_create","x-cli":"node cli/atomiks.mjs ai_credentials.create --json '{...}'","x-session-only":false,"summary":"Cadastrar chave de provedor de IA","description":"Guarda a chave de um provedor (`openai`: `sk-...`; `anthropic`: `sk-ant-...`), cifrada, e devolve só os 4 últimos dígitos. O provedor é consultado: chave recusada dá `invalid_input`; se ele não responder, a chave entra como \"não validada\". A mesma chave duas vezes na conta dá `invalid_input`. `label` é opcional (padrão: o nome do provedor). Sem `TOKEN_ENC_KEY` no servidor responde `credencial_ausente`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic"]},"label":{"type":"string","maxLength":80},"apiKey":{"type":"string","minLength":20,"maxLength":400,"pattern":"^\\S+$"}},"required":["provider","apiKey"]},"example":{"provider":"openai","label":"Chave principal","apiKey":"sk-proj-exemplo-exemplo-exemplo"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["openai","anthropic"]},"label":{"type":"string"},"keyLast4":{"type":"string"},"status":{"type":"string","enum":["active","invalid","revoked"]},"lastValidatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","label","keyLast4","status","lastValidatedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ai_credentials.delete":{"post":{"operationId":"ai_credentials.delete","tags":["ai_credentials"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/ai_credentials.delete.md"},"x-mcp-tool":"ai_credentials_delete","x-cli":"node cli/atomiks.mjs ai_credentials.delete --json '{...}'","x-session-only":false,"summary":"Remover chave de provedor de IA","description":"Remove a chave: o valor cifrado é apagado e o cadastro fica como `revoked`. Chave usada por agente (que não foi excluído) responde `limit_reached`; troque a chave do agente antes.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.list":{"post":{"operationId":"custom_objects.list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.list.md"},"x-mcp-tool":"custom_objects_list","x-cli":"node cli/atomiks.mjs custom_objects.list --json '{...}'","x-session-only":false,"summary":"Listar objetos personalizados","description":"Objetos personalizados da conta, do mais antigo ao mais novo, com nome no singular e no plural, `apiName` (não muda se o objeto for renomeado), ícone, cor, gênero da palavra (`masculine`/`feminine`), campo-título e as contagens de registros, campos ativos e ligações. Os arquivados só vêm com `includeArchived: true`. Exige o módulo de plano `crm.custom-objects`; sem a migration, a lista vem vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"includeArchived":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.overview":{"post":{"operationId":"custom_objects.overview","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.overview.md"},"x-mcp-tool":"custom_objects_overview","x-cli":"node cli/atomiks.mjs custom_objects.overview --json '{...}'","x-session-only":false,"summary":"Visão geral dos objetos e ligações","description":"Tudo da tela Objetos de uma vez: `objects` (arquivados inclusive, com `archivedAt`), `relations` (ligações dos objetos, com `linkCount`) e `system` (Contatos, Oportunidades e Empresas com `recordCount` e `customFieldCount`; Oportunidades e Empresas não têm campos personalizados no Atomiks).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}},"relations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"sourceObject":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},"sourceLabel":{"type":"string"},"targetLabel":{"type":"string"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":["string","null"]},"targetObject":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},{"type":"null"}]},"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"showOnCard":{"type":"boolean"},"linkCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","sourceObject","sourceLabel","targetLabel","targetType","targetObjectId","targetObject","cardinality","showOnCard","linkCount","createdAt","updatedAt"],"additionalProperties":false}},"system":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["leads","opportunities","companies"]},"recordCount":{"type":"number"},"customFieldCount":{"type":"number"}},"required":["type","recordCount","customFieldCount"],"additionalProperties":false}}},"required":["objects","relations","system"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.get":{"post":{"operationId":"custom_objects.get","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.get.md"},"x-mcp-tool":"custom_objects_get","x-cli":"node cli/atomiks.mjs custom_objects.get --json '{...}'","x-session-only":false,"summary":"Ver um objeto","description":"Um objeto com o campo-título (`titleField`) e as contagens de registros, campos ativos e ligações. Objeto de outra conta ou inexistente dá `not_found`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.create":{"post":{"operationId":"custom_objects.create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.create.md"},"x-mcp-tool":"custom_objects_create","x-cli":"node cli/atomiks.mjs custom_objects.create --json '{...}'","x-session-only":false,"summary":"Criar objeto personalizado","description":"Cria o objeto. `singularName`/`pluralName` (até 60 caracteres), `gender` (`masculine` ou `feminine`, padrão masculino), `icon` (casa, prédio, carro… ver `custom_objects.list`) e `color` (teal, blue, violet, pink, orange, amber, green, slate). `apiName` sai do nome no plural (sem acento, minúsculo, `_` entre palavras; repetido ganha `_2`, `_3`) e nunca muda. `fields` cria os campos juntos (os modelos Imóveis, Veículos, Contratos e Turmas da tela são listas de campos): um deles, de tipo `text`, é o campo-título (`isTitle: true`; sem marca, o primeiro texto). Sem `fields`, nasce só o campo texto \"Nome\" como título. Tipos: text, textarea, number, currency, percentage, date, select, multi_select, radio, link, rating, boolean, file, image; os de seleção levam `options`. Exige a migration de objetos (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"singularName":{"type":"string","minLength":1,"maxLength":60},"pluralName":{"type":"string","minLength":1,"maxLength":60},"gender":{"type":"string","enum":["masculine","feminine"]},"icon":{"type":"string","enum":["home","building","car","contract","graduation","box","key","tag","calendar","pin","wrench","heart","star","plane","paw","grid"]},"color":{"type":"string","enum":["teal","blue","violet","pink","orange","amber","green","slate"]},"fields":{"maxItems":60,"type":"array","items":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":80},"fieldName":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label"]}]}},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"unique":{"type":"boolean"},"isTitle":{"type":"boolean"}},"required":["displayName","fieldType"]}}},"required":["singularName","pluralName"]},"example":{"singularName":"Imóvel","pluralName":"Imóveis","gender":"masculine","icon":"home","color":"teal","fields":[{"displayName":"Endereço","fieldType":"text","isTitle":true},{"displayName":"Status","fieldType":"select","options":["Disponível","Vendido"]}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.update":{"post":{"operationId":"custom_objects.update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.update.md"},"x-mcp-tool":"custom_objects_update","x-cli":"node cli/atomiks.mjs custom_objects.update --json '{...}'","x-session-only":false,"summary":"Editar objeto personalizado","description":"Muda nome no singular e no plural, gênero, ícone, cor e o campo-título (`titleFieldId`: um campo de texto ativo do objeto; os títulos dos registros são refeitos). Só o que for enviado muda. O `apiName` nunca muda. Objeto arquivado também pode ser editado.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"singularName":{"type":"string","minLength":1,"maxLength":60},"pluralName":{"type":"string","minLength":1,"maxLength":60},"gender":{"type":"string","enum":["masculine","feminine"]},"icon":{"type":"string","enum":["home","building","car","contract","graduation","box","key","tag","calendar","pin","wrench","heart","star","plane","paw","grid"]},"color":{"type":"string","enum":["teal","blue","violet","pink","orange","amber","green","slate"]},"titleFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","pluralName":"Imóveis","color":"blue"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.archive":{"post":{"operationId":"custom_objects.archive","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.archive.md"},"x-mcp-tool":"custom_objects_archive","x-cli":"node cli/atomiks.mjs custom_objects.archive --json '{...}'","x-session-only":false,"summary":"Arquivar objeto","description":"Tira o objeto do menu, dos filtros e das ligações. Os registros e vínculos ficam guardados e voltam ao desarquivar (`custom_objects.unarchive`). Objeto já arquivado não dá erro.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.unarchive":{"post":{"operationId":"custom_objects.unarchive","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.unarchive.md"},"x-mcp-tool":"custom_objects_unarchive","x-cli":"node cli/atomiks.mjs custom_objects.unarchive --json '{...}'","x-session-only":false,"summary":"Desarquivar objeto","description":"Devolve o objeto arquivado ao menu, aos filtros e às ligações, com os registros e vínculos de antes. Objeto que não estava arquivado não dá erro.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]},"apiName":{"type":"string"},"archivedAt":{"type":["string","null"]},"titleFieldId":{"type":["string","null"]},"titleField":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"}},"required":["id","displayName"],"additionalProperties":false},{"type":"null"}]},"recordCount":{"type":"number"},"fieldCount":{"type":"number"},"relationCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","singularName","pluralName","icon","color","gender","apiName","archivedAt","titleFieldId","titleField","recordCount","fieldCount","relationCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.fields_list":{"post":{"operationId":"custom_objects.fields_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.fields_list.md"},"x-mcp-tool":"custom_objects_fields_list","x-cli":"node cli/atomiks.mjs custom_objects.fields_list --json '{...}'","x-session-only":false,"summary":"Listar campos de um objeto","description":"Campos do objeto em ordem. Cada um traz identificador (`fieldName`), rótulo (`displayName`), tipo, opções, `isTitle` (campo-título), `required`, `filterable`, `pinned`, `isActive` e o preenchimento (`fillRate` de 0 a 1, `filledCount` de `totalRecords`). `usageCount`/`usageByKind` contam os consumidores reais (segmentos, flows e agendas que citam o campo). `groupName` é o grupo (nulo = sem grupo) e `unique` diz se o valor não pode repetir entre registros. `groups` traz os grupos com a quantidade de campos ativos e a média de preenchimento. Inativos só com `includeInactive: true`; `search` filtra por nome, identificador ou descrição. Também devolve `totalFields` (ativos), `inactiveFields`, `healthDistribution` (saudável, atenção, crítico, sem uso) e `typeCounts`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"includeInactive":{"type":"boolean"},"onlyInactive":{"type":"boolean"},"search":{"type":"string","maxLength":100}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}},"totalFields":{"type":"number"},"inactiveFields":{"type":"number"},"healthDistribution":{"type":"object","properties":{"healthy":{"type":"number"},"attention":{"type":"number"},"critical":{"type":"number"},"unused":{"type":"number"}},"required":["healthy","attention","critical","unused"],"additionalProperties":false},"typeCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"count":{"type":"number"},"avgFillRate":{"type":"number"}},"required":["name","count","avgFillRate"],"additionalProperties":false}}},"required":["items","totalFields","inactiveFields","healthDistribution","typeCounts","groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.field_create":{"post":{"operationId":"custom_objects.field_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.field_create.md"},"x-mcp-tool":"custom_objects_field_create","x-cli":"node cli/atomiks.mjs custom_objects.field_create --json '{...}'","x-session-only":false,"summary":"Criar campo em um objeto","description":"Cria um campo no objeto. `fieldName` (a-z, 0-9, _) sai do rótulo se omitido e é único no objeto (repetido informado dá `invalid_input`; o gerado ganha `_2`, `_3`). `groupName` põe o campo num grupo e `unique: true` proíbe valor repetido entre registros. O tipo não muda depois. Os tipos `select`, `multi_select` e `radio` exigem `options` (lista de textos ou `{label, value}`); os demais não aceitam. Vai para o fim da lista.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":80},"fieldName":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label"]}]}},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"unique":{"type":"boolean"},"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["displayName","fieldType","objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","displayName":"Bairro","fieldType":"text"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.field_update":{"post":{"operationId":"custom_objects.field_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.field_update.md"},"x-mcp-tool":"custom_objects_field_update","x-cli":"node cli/atomiks.mjs custom_objects.field_update --json '{...}'","x-session-only":false,"summary":"Editar campo de um objeto","description":"Muda rótulo, descrição, opções (só campos de seleção; valores já gravados que saírem das opções continuam guardados), `required`, `filterable`, `pinned`, `groupName` (nulo ou vazio tira do grupo), `unique` e `isActive`. `isActive: false` é o \"Excluir campo\" da tela: o campo sai dos formulários e filtros, os valores continuam guardados e voltam ao reativar (`true`). O identificador e o tipo não mudam. O campo-título não pode ser desativado: troque-o antes em `custom_objects.update`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"displayName":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"options":{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label"]}]}},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"unique":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","displayName":"Bairro","required":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.fields_reorder":{"post":{"operationId":"custom_objects.fields_reorder","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.fields_reorder.md"},"x-mcp-tool":"custom_objects_fields_reorder","x-cli":"node cli/atomiks.mjs custom_objects.fields_reorder --json '{...}'","x-session-only":false,"summary":"Reordenar os campos de um objeto","description":"Define a ordem dos campos: `ids` são os `id` dos campos do objeto, uma vez cada (campos de fora, como os inativos, vão para o fim, na ordem de antes), ou `items` (`{id, order, groupName}`, o que o arrastar da tela envia: muda a posição e o grupo de cada campo citado). Devolve a lista de campos na nova ordem.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"order":{"type":"integer","minimum":0,"maximum":1000},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["id","order"]}}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","ids":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.field_insights":{"post":{"operationId":"custom_objects.field_insights","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.field_insights.md"},"x-mcp-tool":"custom_objects_field_insights","x-cli":"node cli/atomiks.mjs custom_objects.field_insights --json '{...}'","x-session-only":false,"summary":"Uso de um campo de objeto","description":"As abas Uso e Onde é usado do campo: `fillRate`, `fillCount` de `totalEntities`, `emptyCount`, `filledLast30Days`, `trend` (curva acumulada dos últimos 6 meses: `month` AAAA-MM, `filled`, `fillRate`), `numeric` (mínimo, média, máximo e soma, só campos numéricos), `distinctValues`, `topValues` (`label`, `count`, `share`) e `references` (segmentos, flows e agendas que citam o campo; é o que apareceria ao arquivar). `lastEditedAt` é o último preenchimento.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fillRate":{"type":"number"},"fillCount":{"type":"number"},"totalEntities":{"type":"number"},"emptyCount":{"type":"number"},"filledLast30Days":{"type":"number"},"trend":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"filled":{"type":"number"},"fillRate":{"type":"number"}},"required":["month","filled","fillRate"],"additionalProperties":false}},"numeric":{"anyOf":[{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"},"sum":{"type":"number"},"avg":{"type":"number"}},"required":["min","max","sum","avg"],"additionalProperties":false},{"type":"null"}]},"distinctValues":{"type":"number"},"topValues":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"},"share":{"type":"number"}},"required":["label","count","share"],"additionalProperties":false}},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["segment","flow","schedule"]},"id":{"type":"string"},"name":{"type":"string"},"meta":{"type":["string","null"]},"parentId":{"type":["string","null"]}},"required":["kind","id","name","meta","parentId"],"additionalProperties":false}},"lastEditedAt":{"type":["string","null"]}},"required":["fillRate","fillCount","totalEntities","emptyCount","filledLast30Days","trend","numeric","distinctValues","topValues","references","lastEditedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.field_records":{"post":{"operationId":"custom_objects.field_records","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.field_records.md"},"x-mcp-tool":"custom_objects_field_records","x-cli":"node cli/atomiks.mjs custom_objects.field_records --json '{...}'","x-session-only":false,"summary":"Quem preencheu um campo de objeto","description":"A aba Quem preencheu: os registros que têm valor no campo, do preenchimento mais recente para o mais antigo (`limit` até 100, padrão 50). Cada um traz `entityId`, `name` (título do registro), `value` em texto, `filledAt` e `source` (manual, import, form, booking, webchat, flow, api, system, unknown; valor sem origem registrada vem como `unknown`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"entityId":{"type":"string"},"entityType":{"type":"string","const":"objects"},"name":{"type":["string","null"]},"value":{"type":"string"},"filledAt":{"type":"string"},"source":{"type":"string","enum":["manual","import","form","booking","webchat","flow","api","system","unknown"]}},"required":["entityId","entityType","name","value","filledAt","source"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.field_groups":{"post":{"operationId":"custom_objects.field_groups","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.field_groups.md"},"x-mcp-tool":"custom_objects_field_groups","x-cli":"node cli/atomiks.mjs custom_objects.field_groups --json '{...}'","x-session-only":false,"summary":"Grupos de campos de um objeto","description":"Nomes dos grupos já usados pelos campos do objeto (para o seletor \"Grupo\"), em ordem alfabética.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.fields_bulk_update":{"post":{"operationId":"custom_objects.fields_bulk_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.fields_bulk_update.md"},"x-mcp-tool":"custom_objects_fields_bulk_update","x-cli":"node cli/atomiks.mjs custom_objects.fields_bulk_update --json '{...}'","x-session-only":false,"summary":"Alterar vários campos de um objeto","description":"Aplica o mesmo `patch` a vários campos (`ids`, até 200, do mesmo objeto): `groupName` (nulo tira do grupo), `filterable`, `pinned`, `required` e `isActive`. O campo-título não pode ser desativado. Devolve `updated`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"patch":{"type":"object","properties":{"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"required":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"required":["ids","patch"]},"example":{"ids":["00000000-0000-0000-0000-000000000000"],"patch":{"pinned":true}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.relations_list":{"post":{"operationId":"custom_objects.relations_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.relations_list.md"},"x-mcp-tool":"custom_objects_relations_list","x-cli":"node cli/atomiks.mjs custom_objects.relations_list --json '{...}'","x-session-only":false,"summary":"Listar ligações dos objetos","description":"Ligações entre objetos e Contatos, Oportunidades, Empresas ou outros objetos. Com `objectId`, as que envolvem o objeto (como origem ou como alvo); sem ele, todas. Cada uma traz os dois nomes (`sourceLabel` na ficha da origem, `targetLabel` na ficha do outro lado), `cardinality` (`many_to_one`: cada registro da origem tem um só do outro lado; `one_to_many`: o outro lado tem um só da origem; `many_to_many`), `showOnCard` (selo no card da oportunidade) e `linkCount` (quantos vínculos existem). As ligações fixas do sistema entre Contatos, Oportunidades e Empresas não entram.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"sourceObject":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},"sourceLabel":{"type":"string"},"targetLabel":{"type":"string"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":["string","null"]},"targetObject":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},{"type":"null"}]},"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"showOnCard":{"type":"boolean"},"linkCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","sourceObject","sourceLabel","targetLabel","targetType","targetObjectId","targetObject","cardinality","showOnCard","linkCount","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.relation_create":{"post":{"operationId":"custom_objects.relation_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.relation_create.md"},"x-mcp-tool":"custom_objects_relation_create","x-cli":"node cli/atomiks.mjs custom_objects.relation_create --json '{...}'","x-session-only":false,"summary":"Criar ligação de um objeto","description":"Liga o objeto (`objectId`, a origem) a Contatos (`leads`), Oportunidades (`opportunities`), Empresas (`companies`) ou outro objeto (`objects` + `targetObjectId`, que pode ser o próprio objeto: aí os dois nomes precisam ser diferentes). `cardinality`: `many_to_one` (cada registro da origem tem um só do outro lado), `one_to_many` (cada um do outro lado tem um só da origem) ou `many_to_many`. `sourceLabel` aparece na ficha da origem e `targetLabel` na ficha do outro lado. `showOnCard` só vale com Oportunidades (selo no card do kanban). Nome repetido entre os mesmos dois lados dá `invalid_input`. Objetos arquivados não recebem ligação.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"sourceLabel":{"type":"string","minLength":1,"maxLength":60},"targetLabel":{"type":"string","minLength":1,"maxLength":60},"showOnCard":{"type":"boolean"},"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["cardinality","sourceLabel","targetLabel","objectId","targetType"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","targetType":"leads","cardinality":"many_to_one","sourceLabel":"Proprietário","targetLabel":"Imóveis"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"sourceObject":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},"sourceLabel":{"type":"string"},"targetLabel":{"type":"string"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":["string","null"]},"targetObject":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},{"type":"null"}]},"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"showOnCard":{"type":"boolean"},"linkCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","sourceObject","sourceLabel","targetLabel","targetType","targetObjectId","targetObject","cardinality","showOnCard","linkCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.relation_update":{"post":{"operationId":"custom_objects.relation_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.relation_update.md"},"x-mcp-tool":"custom_objects_relation_update","x-cli":"node cli/atomiks.mjs custom_objects.relation_update --json '{...}'","x-session-only":false,"summary":"Editar ligação","description":"Renomeia os dois lados, liga ou desliga `showOnCard` (só com Oportunidades) e muda `cardinality` — esta só enquanto a ligação não tem vínculos (senão `invalid_input` com a contagem). Os dois lados da outra ponta não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"sourceLabel":{"type":"string","minLength":1,"maxLength":60},"targetLabel":{"type":"string","minLength":1,"maxLength":60},"showOnCard":{"type":"boolean"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","sourceLabel":"Dono","targetLabel":"Imóveis do dono"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"sourceObject":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},"sourceLabel":{"type":"string"},"targetLabel":{"type":"string"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":["string","null"]},"targetObject":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},{"type":"null"}]},"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"showOnCard":{"type":"boolean"},"linkCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","sourceObject","sourceLabel","targetLabel","targetType","targetObjectId","targetObject","cardinality","showOnCard","linkCount","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.relation_delete":{"post":{"operationId":"custom_objects.relation_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.relation_delete.md"},"x-mcp-tool":"custom_objects_relation_delete","x-cli":"node cli/atomiks.mjs custom_objects.relation_delete --json '{...}'","x-session-only":false,"summary":"Excluir ligação","description":"Exclui a ligação e apaga os vínculos dela dos dois lados. Não dá para desfazer. Os registros ficam. Devolve `linksRemoved`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"linksRemoved":{"type":"number"}},"required":["id","linksRemoved"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.access_list":{"post":{"operationId":"custom_objects.access_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.access_list.md"},"x-mcp-tool":"custom_objects_access_list","x-cli":"node cli/atomiks.mjs custom_objects.access_list --json '{...}'","x-session-only":false,"summary":"Cargos e permissões de objetos","description":"A aba Acesso: quem mexe nos registros. O Atomiks não tem grupos de permissão, então os \"cargos\" são os papéis do membro: `admin` (ver, criar, editar, excluir e configurar, em todos os registros) e `user` (ver, criar, editar e excluir todos os registros, sem configurar objetos, campos e ligações). Cada cargo traz `members` (ids dos membros) e `permissions` (`custom-objects:<ação>:all`). A permissão vale para todos os objetos juntos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}}},"required":["id","name","members","permissions"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_query":{"post":{"operationId":"custom_objects.records_query","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_query.md"},"x-mcp-tool":"custom_objects_records_query","x-cli":"node cli/atomiks.mjs custom_objects.records_query --json '{...}'","x-session-only":false,"summary":"Listar registros de um objeto","description":"Registros do objeto, 50 por página (`perPage` até 200). `filters` é uma lista (todos valem): `{fieldId, op, value}` com `fieldId` = id de um campo, `title`, `responsible` (id do responsável) ou `createdAt`/`updatedAt` (AAAA-MM-DD, compara o dia) e `op` em eq, neq, contains, not_contains, gt, gte, lt, lte, empty, not_empty, in, not_in, starts_with, ends_with. `relations` filtra por ligação (`{relationId, side, quantifier: any|all|none, value?, conditions?}`: o registro tem (algum, todos) ou não tem vínculo; `value` restringe ao outro lado cujo nome contém o texto e `conditions` (`{fieldId, op, value}`, as chaves vêm de `custom_objects.relation_filter_fields`) aos vínculos cujo outro lado cumpre todas as condições). Cada registro traz `relations` (por ligação e lado: `count` e `preview` com os 3 primeiros vínculos). `search` procura no título e nos textos. Ordem: `sortBy` (title, responsible, createdAt, updatedAt) ou `sortFieldId`, com `sortDir`; o padrão é o mais novo primeiro. `responsibleAttendantId` limita ao responsável. Cada registro traz `title` (valor do campo-título), `values` (`{<id do campo>: valor}`) e o responsável. `meta` traz página, total de páginas e de itens.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"relations":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"side":{"type":"string","enum":["source","target"]},"quantifier":{"type":"string","enum":["any","all","none"]},"value":{"type":"string","maxLength":200},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":80},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}}},"required":["relationId","side","quantifier"]}},"search":{"type":"string","maxLength":200},"responsibleAttendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sortBy":{"type":"string","enum":["title","responsible","createdAt","updatedAt"]},"sortFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sortDir":{"type":"string","enum":["asc","desc"]},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":200}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","search":"centro"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"title":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"responsibleAttendantId":{"type":["string","null"]},"responsibleAttendantName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"relations":{"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string"},"side":{"type":"string","enum":["source","target"]},"count":{"type":"number"},"preview":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["relationId","side","count","preview"],"additionalProperties":false}}},"required":["id","objectId","title","values","responsibleAttendantId","responsibleAttendantName","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countPages":{"type":"number"},"countItens":{"type":"number"}},"required":["page","perPage","countPages","countItens"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.relation_filter_fields":{"post":{"operationId":"custom_objects.relation_filter_fields","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.relation_filter_fields.md"},"x-mcp-tool":"custom_objects_relation_filter_fields","x-cli":"node cli/atomiks.mjs custom_objects.relation_filter_fields --json '{...}'","x-session-only":false,"summary":"Campos filtráveis do outro lado de uma ligação","description":"Campos que o filtro por ligação aceita nas pontas: `side` é o lado em que estão os registros do objeto (`source` = a ponta é o alvo da ligação; `target` = a ponta é o objeto dono). Devolve `type` e `objectId` da ponta e `fields` (`key` para o `fieldId` de `conditions`, `label`, `group` fields|dates, `type` text|number|date|boolean|enum, `multi` e `enumOptions`). Contato: nome, telefone, e-mail, criação e campos personalizados; oportunidade: título, situação, valor e criação; objeto: título, campos filtráveis e datas; empresa não tem campos (só ter ou não vínculo).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"side":{"type":"string","enum":["source","target"]}},"required":["relationId","side"]},"example":{"relationId":"00000000-0000-0000-0000-000000000000","side":"source"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"type":{"type":"string","enum":["leads","opportunities","companies","objects"]},"objectId":{"type":["string","null"]},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"group":{"type":"string","enum":["fields","dates"]},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"multi":{"type":"boolean"},"enumOptions":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"additionalProperties":false}}},"required":["key","label","group","type"],"additionalProperties":false}}},"required":["type","objectId","fields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_search":{"post":{"operationId":"custom_objects.records_search","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_search.md"},"x-mcp-tool":"custom_objects_records_search","x-cli":"node cli/atomiks.mjs custom_objects.records_search --json '{...}'","x-session-only":false,"summary":"Buscar registros de um objeto por título","description":"Busca rápida (seletor de vínculos): registros cujo título contém `q`, até `limit` (padrão 20, máximo 50). Cada achado traz `id`, `title` e `subtitle` (o primeiro outro texto do registro).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":200},"limit":{"type":"integer","minimum":1,"maximum":50}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","q":"apto"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]}},"required":["id","title","subtitle"],"additionalProperties":false}}},"required":["hits"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_get":{"post":{"operationId":"custom_objects.record_get","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_get.md"},"x-mcp-tool":"custom_objects_record_get","x-cli":"node cli/atomiks.mjs custom_objects.record_get --json '{...}'","x-session-only":false,"summary":"Ver um registro","description":"Um registro do objeto com título, valores por campo e responsável. Registro de outra conta ou inexistente dá `not_found`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"title":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"responsibleAttendantId":{"type":["string","null"]},"responsibleAttendantName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"relations":{"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string"},"side":{"type":"string","enum":["source","target"]},"count":{"type":"number"},"preview":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["relationId","side","count","preview"],"additionalProperties":false}}},"required":["id","objectId","title","values","responsibleAttendantId","responsibleAttendantName","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_create":{"post":{"operationId":"custom_objects.record_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_create.md"},"x-mcp-tool":"custom_objects_record_create","x-cli":"node cli/atomiks.mjs custom_objects.record_create --json '{...}'","x-session-only":false,"summary":"Criar registro de um objeto","description":"Cria um registro. `values` é `{<id do campo>: valor}` ou a lista `[{customFieldId, value}]` do original; cada valor é validado pelo tipo do campo (texto, número, data AAAA-MM-DD, opção existente, link http…), campo obrigatório vazio e título vazio dão `invalid_input`. `responsibleAttendantId` é o responsável (membro da conta). `links` já liga o registro novo: `{relationId, targetId}` quando o objeto é a origem da ligação, ou `{relationId, recordId}` quando é o alvo (`recordId` = registro de origem). Objeto arquivado não recebe registro.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"values":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"maxItems":100,"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{}},"required":["customFieldId","value"]}}]},"responsibleAttendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"links":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["relationId"]}}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","values":{"00000000-0000-0000-0000-000000000001":"Apto 101"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"title":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"responsibleAttendantId":{"type":["string","null"]},"responsibleAttendantName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"relations":{"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string"},"side":{"type":"string","enum":["source","target"]},"count":{"type":"number"},"preview":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["relationId","side","count","preview"],"additionalProperties":false}}},"required":["id","objectId","title","values","responsibleAttendantId","responsibleAttendantName","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_update":{"post":{"operationId":"custom_objects.record_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_update.md"},"x-mcp-tool":"custom_objects_record_update","x-cli":"node cli/atomiks.mjs custom_objects.record_update --json '{...}'","x-session-only":false,"summary":"Editar registro","description":"Altera valores e/ou responsável. Só os campos enviados em `values` mudam; valor vazio (`null`, texto vazio, lista vazia) apaga. `responsibleAttendantId: null` tira o responsável. Valida pelo tipo e pelos campos obrigatórios, como na criação. O título é refeito a partir do campo-título.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"values":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"maxItems":100,"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{}},"required":["customFieldId","value"]}}]},"responsibleAttendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","values":{"00000000-0000-0000-0000-000000000001":"Apto 102"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"title":{"type":"string"},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"responsibleAttendantId":{"type":["string","null"]},"responsibleAttendantName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"relations":{"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string"},"side":{"type":"string","enum":["source","target"]},"count":{"type":"number"},"preview":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["relationId","side","count","preview"],"additionalProperties":false}}},"required":["id","objectId","title","values","responsibleAttendantId","responsibleAttendantName","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_delete":{"post":{"operationId":"custom_objects.record_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_delete.md"},"x-mcp-tool":"custom_objects_record_delete","x-cli":"node cli/atomiks.mjs custom_objects.record_delete --json '{...}'","x-session-only":false,"summary":"Excluir registro","description":"Exclui o registro com suas notas, atividades e vínculos (dos dois lados). Não dá para desfazer.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_bulk_delete":{"post":{"operationId":"custom_objects.records_bulk_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_bulk_delete.md"},"x-mcp-tool":"custom_objects_records_bulk_delete","x-cli":"node cli/atomiks.mjs custom_objects.records_bulk_delete --json '{...}'","x-session-only":false,"summary":"Excluir registros em massa","description":"Exclui vários registros do objeto de uma vez: `recordIds` (até 5.000) ou `allMatching: true` com `filters`/`search` (tudo o que casa). Até 200 registros roda na hora (`mode: \"sync\"`, com `affected`); acima disso vira uma tarefa em segundo plano (`mode: \"async\"`, com `jobId`): acompanhe com `custom_objects.record_job_get` (até 100.000 registros). Não dá para desfazer.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recordIds":{"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean"},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"relations":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"side":{"type":"string","enum":["source","target"]},"quantifier":{"type":"string","enum":["any","all","none"]},"value":{"type":"string","maxLength":200},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":80},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}}},"required":["relationId","side","quantifier"]}},"search":{"type":"string","maxLength":200}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","recordIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"sync"},"affected":{"type":"number"}},"required":["mode","affected"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"async"},"jobId":{"type":"string"}},"required":["mode","jobId"],"additionalProperties":false}]}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_bulk_update":{"post":{"operationId":"custom_objects.records_bulk_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_bulk_update.md"},"x-mcp-tool":"custom_objects_records_bulk_update","x-cli":"node cli/atomiks.mjs custom_objects.records_bulk_update --json '{...}'","x-session-only":false,"summary":"Alterar registros em massa","description":"Aplica uma mudança a vários registros: mesma seleção da exclusão em massa (`recordIds` ou `allMatching` + `filters`/`search`) e `target`: `responsible` (`responsibleAttendantId`, `null` tira o responsável), `field` (`customFieldId` e `value`; `value: null` limpa o campo; vale a validação do tipo) ou `note` (`note`, uma nota nova em cada registro). Até 200 registros roda na hora (`mode: \"sync\"`, com `affected`); acima disso vira uma tarefa em segundo plano (`mode: \"async\"`, com `jobId`): acompanhe com `custom_objects.record_job_get` (até 100.000 registros).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recordIds":{"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean"},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"relations":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"side":{"type":"string","enum":["source","target"]},"quantifier":{"type":"string","enum":["any","all","none"]},"value":{"type":"string","maxLength":200},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":80},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}}},"required":["relationId","side","quantifier"]}},"search":{"type":"string","maxLength":200},"target":{"type":"string","enum":["responsible","field","note"]},"responsibleAttendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{},"note":{"type":"string","minLength":1,"maxLength":10000}},"required":["objectId","target"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","recordIds":["00000000-0000-0000-0000-000000000000"],"target":"responsible","responsibleAttendantId":null}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"sync"},"affected":{"type":"number"}},"required":["mode","affected"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"async"},"jobId":{"type":"string"}},"required":["mode","jobId"],"additionalProperties":false}]}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_notes_list":{"post":{"operationId":"custom_objects.record_notes_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_notes_list.md"},"x-mcp-tool":"custom_objects_record_notes_list","x-cli":"node cli/atomiks.mjs custom_objects.record_notes_list --json '{...}'","x-session-only":false,"summary":"Listar notas de um registro","description":"Notas do registro, da mais nova para a mais antiga, com o autor.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["recordId"]},"example":{"recordId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"recordId":{"type":"string"},"body":{"type":"string"},"authorId":{"type":["string","null"]},"authorName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","recordId","body","authorId","authorName","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_note_create":{"post":{"operationId":"custom_objects.record_note_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_note_create.md"},"x-mcp-tool":"custom_objects_record_note_create","x-cli":"node cli/atomiks.mjs custom_objects.record_note_create --json '{...}'","x-session-only":false,"summary":"Criar nota em um registro","description":"Adiciona uma nota (até 10.000 caracteres, Markdown simples) ao registro. O autor é quem chama.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["recordId","body"]},"example":{"recordId":"00000000-0000-0000-0000-000000000000","body":"Cliente pediu retorno na sexta."}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"recordId":{"type":"string"},"body":{"type":"string"},"authorId":{"type":["string","null"]},"authorName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","recordId","body","authorId","authorName","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_note_update":{"post":{"operationId":"custom_objects.record_note_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_note_update.md"},"x-mcp-tool":"custom_objects_record_note_update","x-cli":"node cli/atomiks.mjs custom_objects.record_note_update --json '{...}'","x-session-only":false,"summary":"Editar nota de um registro","description":"Troca o texto da nota. Só quem escreveu a nota ou um administrador pode editar.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"noteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["recordId","noteId","body"]},"example":{"recordId":"00000000-0000-0000-0000-000000000000","noteId":"00000000-0000-0000-0000-000000000000","body":"Cliente pediu retorno na segunda."}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"recordId":{"type":"string"},"body":{"type":"string"},"authorId":{"type":["string","null"]},"authorName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","recordId","body","authorId","authorName","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_note_delete":{"post":{"operationId":"custom_objects.record_note_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_note_delete.md"},"x-mcp-tool":"custom_objects_record_note_delete","x-cli":"node cli/atomiks.mjs custom_objects.record_note_delete --json '{...}'","x-session-only":false,"summary":"Excluir nota de um registro","description":"Exclui a nota. Só quem escreveu ou um administrador pode excluir.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"noteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["recordId","noteId"]},"example":{"recordId":"00000000-0000-0000-0000-000000000000","noteId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_activities":{"post":{"operationId":"custom_objects.record_activities","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_activities.md"},"x-mcp-tool":"custom_objects_record_activities","x-cli":"node cli/atomiks.mjs custom_objects.record_activities --json '{...}'","x-session-only":false,"summary":"Histórico de um registro","description":"Linha do tempo do registro, da mais nova para a mais antiga: criação, edições, responsável, vínculos e notas (`type`: created, updated, link_created, link_deleted, note_added), com `metadata` e o autor.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["recordId"]},"example":{"recordId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","type","metadata","actorId","actorName","createdAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countPages":{"type":"number"},"countItens":{"type":"number"}},"required":["page","perPage","countPages","countItens"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.links_list":{"post":{"operationId":"custom_objects.links_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.links_list.md"},"x-mcp-tool":"custom_objects_links_list","x-cli":"node cli/atomiks.mjs custom_objects.links_list --json '{...}'","x-session-only":false,"summary":"Vínculos de um registro ou de um contato, oportunidade ou empresa","description":"O que está ligado a uma coisa, agrupado por ligação (o que a ficha de contato, oportunidade, empresa e registro mostra). `targetType` é `leads` (contato), `opportunities`, `companies` ou `objects` (`targetId` é o id de um registro). Cada grupo traz a `relation`, o `side` em que a coisa está (`source`: ela é a origem e os itens são o outro lado; `target`: ela é o alvo e os itens são registros de objetos) e `items` (`linkId`, `type`, `id`, `label`, `subtitle`). Ligações sem vínculo também vêm, com `items` vazio. Objetos arquivados ficam de fora.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["targetType","targetId"]},"example":{"targetType":"leads","targetId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"relation":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"sourceObject":{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},"sourceLabel":{"type":"string"},"targetLabel":{"type":"string"},"targetType":{"type":"string","enum":["leads","opportunities","companies","objects"]},"targetObjectId":{"type":["string","null"]},"targetObject":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"singularName":{"type":"string"},"pluralName":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"gender":{"type":"string","enum":["masculine","feminine"]}},"required":["id","singularName","pluralName","icon","color","gender"],"additionalProperties":false},{"type":"null"}]},"cardinality":{"type":"string","enum":["many_to_one","one_to_many","many_to_many"]},"showOnCard":{"type":"boolean"},"linkCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","sourceObject","sourceLabel","targetLabel","targetType","targetObjectId","targetObject","cardinality","showOnCard","linkCount","createdAt","updatedAt"],"additionalProperties":false},"side":{"type":"string","enum":["source","target"]},"items":{"type":"array","items":{"type":"object","properties":{"linkId":{"type":"string"},"type":{"type":"string","enum":["leads","opportunities","companies","objects"]},"id":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]}},"required":["linkId","type","id","label","subtitle"],"additionalProperties":false}}},"required":["relation","side","items"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.link_create":{"post":{"operationId":"custom_objects.link_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.link_create.md"},"x-mcp-tool":"custom_objects_link_create","x-cli":"node cli/atomiks.mjs custom_objects.link_create --json '{...}'","x-session-only":false,"summary":"Vincular registros","description":"Cria vínculos de uma ligação: `relationId` e `links` (`{recordId, targetId}`: `recordId` é o registro da origem — do objeto dono da ligação — e `targetId` o contato, oportunidade, empresa ou registro do outro lado). Lado \"um\" da cardinalidade guarda um vínculo só: ligar de novo troca o anterior (`replaced` conta as trocas). Vínculo que já existe é ignorado. Objetos arquivados não recebem vínculos.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"links":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["recordId","targetId"]}}},"required":["relationId","links"]},"example":{"relationId":"00000000-0000-0000-0000-000000000000","links":[{"recordId":"00000000-0000-0000-0000-000000000000","targetId":"00000000-0000-0000-0000-000000000000"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"relationId":{"type":"string"},"recordId":{"type":"string"},"targetId":{"type":"string"}},"required":["id","relationId","recordId","targetId"],"additionalProperties":false}},"replaced":{"type":"number"}},"required":["items","replaced"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.link_delete":{"post":{"operationId":"custom_objects.link_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.link_delete.md"},"x-mcp-tool":"custom_objects_link_delete","x-cli":"node cli/atomiks.mjs custom_objects.link_delete --json '{...}'","x-session-only":false,"summary":"Desfazer um vínculo","description":"Remove o vínculo (os dois registros continuam).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"linkId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["linkId"]},"example":{"linkId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.links_opportunity_badges":{"post":{"operationId":"custom_objects.links_opportunity_badges","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.links_opportunity_badges.md"},"x-mcp-tool":"custom_objects_links_opportunity_badges","x-cli":"node cli/atomiks.mjs custom_objects.links_opportunity_badges --json '{...}'","x-session-only":false,"summary":"Selos de objetos nos cards de oportunidade","description":"Para cada oportunidade de `opportunityIds` (até 200), os registros ligados por ligações com `showOnCard` ligado: `{opportunityId, relationId, recordId, title, objectId, icon, color, label}` (`label` é o nome da ligação do lado da oportunidade). É o selo do card no kanban.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"opportunityIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["opportunityIds"]},"example":{"opportunityIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"opportunityId":{"type":"string"},"relationId":{"type":"string"},"recordId":{"type":"string"},"title":{"type":"string"},"objectId":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"label":{"type":"string"}},"required":["opportunityId","relationId","recordId","title","objectId","icon","color","label"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.views_list":{"post":{"operationId":"custom_objects.views_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.views_list.md"},"x-mcp-tool":"custom_objects_views_list","x-cli":"node cli/atomiks.mjs custom_objects.views_list --json '{...}'","x-session-only":false,"summary":"Listar visões salvas de um objeto","description":"Visões salvas da listagem de registros (filtros, layout `table`/`cards`/`kanban`, campo do kanban e colunas), da mais antiga para a mais nova.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{}},"layout":{"anyOf":[{"type":"string","enum":["table","cards","kanban"]},{"type":"null"}]},"kanbanFieldId":{"type":["string","null"]},"display":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","name","filters","layout","kanbanFieldId","display","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.view_create":{"post":{"operationId":"custom_objects.view_create","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.view_create.md"},"x-mcp-tool":"custom_objects_view_create","x-cli":"node cli/atomiks.mjs custom_objects.view_create --json '{...}'","x-session-only":false,"summary":"Salvar visão de um objeto","description":"Salva a listagem atual: `name` (até 80 caracteres), `filters` (mesmo formato de `custom_objects.records_query`), `layout`, `kanbanFieldId` e `display` (por exemplo `columnOrder`).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"layout":{"anyOf":[{"type":"string","enum":["table","cards","kanban"]},{"type":"null"}]},"kanbanFieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"display":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["objectId","name"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","name":"Disponíveis","filters":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{}},"layout":{"anyOf":[{"type":"string","enum":["table","cards","kanban"]},{"type":"null"}]},"kanbanFieldId":{"type":["string","null"]},"display":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","name","filters","layout","kanbanFieldId","display","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.view_update":{"post":{"operationId":"custom_objects.view_update","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.view_update.md"},"x-mcp-tool":"custom_objects_view_update","x-cli":"node cli/atomiks.mjs custom_objects.view_update --json '{...}'","x-session-only":false,"summary":"Atualizar visão salva","description":"Regrava a visão com os filtros e o layout enviados e/ou renomeia (`name`). Só o que for enviado muda.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"layout":{"anyOf":[{"type":"string","enum":["table","cards","kanban"]},{"type":"null"}]},"kanbanFieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"display":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","filters":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{}},"layout":{"anyOf":[{"type":"string","enum":["table","cards","kanban"]},{"type":"null"}]},"kanbanFieldId":{"type":["string","null"]},"display":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","objectId","name","filters","layout","kanbanFieldId","display","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.view_delete":{"post":{"operationId":"custom_objects.view_delete","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.view_delete.md"},"x-mcp-tool":"custom_objects_view_delete","x-cli":"node cli/atomiks.mjs custom_objects.view_delete --json '{...}'","x-session-only":false,"summary":"Excluir visão salva","description":"Exclui a visão salva. Os registros não mudam.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_export":{"post":{"operationId":"custom_objects.records_export","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_export.md"},"x-mcp-tool":"custom_objects_records_export","x-cli":"node cli/atomiks.mjs custom_objects.records_export --json '{...}'","x-session-only":false,"summary":"Exportar registros de um objeto em CSV","description":"Cria a tarefa de exportação (`kind: \"export\"`, `state: \"waiting\"`) e devolve na hora; o worker gera o CSV em segundo plano. Acompanhe com `custom_objects.record_job_get` (`progress`, `state`): ao ficar `completed`, `downloadUrl` é o link do arquivo (vale 5 minutos; a cada consulta vem um novo; o arquivo fica guardado por 24 horas). Seleção como a das ações em massa: `recordIds` (até 5.000) ou `allMatching: true` com `filters`/`relations`/`search`. `columns` (na ordem do arquivo): `cf:<id do campo>`, `rel:<id da ligação>:<source|target>` (nomes dos vinculados, separados por \"; \"), `responsible`, `createdAt`, `updatedAt`, `id`. Até 100.000 registros. `notifyEmail` (opcional): ao terminar, manda para esse endereço um e-mail com o link do arquivo, válido pelas 24 horas em que ele fica guardado.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recordIds":{"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean"},"filters":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"fieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","enum":["title","responsible","createdAt","updatedAt"]}]},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}},"relations":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"relationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"side":{"type":"string","enum":["source","target"]},"quantifier":{"type":"string","enum":["any","all","none"]},"value":{"type":"string","maxLength":200},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":80},"op":{"type":"string","enum":["eq","neq","contains","not_contains","gt","gte","lt","lte","empty","not_empty","in","not_in","starts_with","ends_with"]},"value":{}},"required":["fieldId","op"]}}},"required":["relationId","side","quantifier"]}},"search":{"type":"string","maxLength":200},"columns":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","pattern":"^(cf:[0-9a-f-]{36}|rel:[0-9a-f-]{36}:(source|target)|responsible|createdAt|updatedAt|id)$"}},"notifyEmail":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["objectId","columns"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","allMatching":true,"columns":["responsible","createdAt"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["bulk_update","bulk_delete","export","import"]},"state":{"type":"string","enum":["waiting","active","completed","failed"]},"progress":{"type":"number"},"total":{"type":"number"},"affected":{"type":["number","null"]},"fileName":{"type":["string","null"]},"downloadUrl":{"type":["string","null"]},"csv":{"type":["string","null"]},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"failedReason":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","kind","state","progress","total","affected","fileName","downloadUrl","csv","meta","failedReason","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_import_upload_url":{"post":{"operationId":"custom_objects.records_import_upload_url","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_import_upload_url.md"},"x-mcp-tool":"custom_objects_records_import_upload_url","x-cli":"node cli/atomiks.mjs custom_objects.records_import_upload_url --json '{...}'","x-session-only":false,"summary":"Pedir URL para enviar a planilha de importação","description":"Primeiro passo da importação (equivale a `records/import/upload` do original). Devolve `uploadId` e uma URL assinada (vale 2 horas): envie o CSV cru com `PUT` em `signedUrl` (corpo = o arquivo, `Content-Type: text/csv`; até 100 MB). Depois chame `custom_objects.records_import` com `uploadId`. Só quem pediu a URL importa o arquivo. `fileName` termina em .csv, .tsv ou .txt (o original também não lê .xlsx).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":104857600}},"required":["objectId","fileName","size"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","fileName":"imoveis.csv","size":1048576}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"uploadId":{"type":"string"},"signedUrl":{"type":"string"},"token":{"type":"string"},"path":{"type":"string"}},"required":["uploadId","signedUrl","token","path"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_import":{"post":{"operationId":"custom_objects.records_import","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_import.md"},"x-mcp-tool":"custom_objects_records_import","x-cli":"node cli/atomiks.mjs custom_objects.records_import --json '{...}'","x-session-only":false,"summary":"Importar registros de uma planilha","description":"Cria a tarefa de importação (`kind: \"import\"`, `state: \"waiting\"`) do arquivo enviado com `records_import_upload_url` (`uploadId`) e devolve na hora; o worker lê o arquivo em lotes de 500 linhas (até 100.000). `columnMappings`: `{csvColumn, customFieldId}` (o campo-título precisa estar mapeado; a coluna é o texto do cabeçalho do arquivo). Cada célula é lida pelo tipo do campo (números \"1.234,56\", datas \"26/10/2026\", sim/não, opções pelo nome). `matchFieldId` casa com registros que já existem pelo valor desse campo e `conflictStrategy` decide: `merge` preenche só o que está vazio, `overwrite` troca os valores mapeados, `keep` pula a linha. Sem `matchFieldId`, toda linha cria registro. `responsibleAttendantId` vale para os criados. Acompanhe com `custom_objects.record_job_get`: `progress`, `affected` (criados + atualizados) e, em `meta`: `created`, `updated`, `skipped`, `failed` e `errors` (`{row, message}`, até 50; a linha 2 é a primeira de dados). Valores entram com a origem `import`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fileName":{"type":"string","minLength":1,"maxLength":200},"columnMappings":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"csvColumn":{"type":"string","maxLength":200},"customFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["csvColumn","customFieldId"]}},"matchFieldId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"conflictStrategy":{"type":"string","enum":["merge","overwrite","keep"]},"responsibleAttendantId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"totalRows":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["objectId","uploadId","fileName","columnMappings"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","uploadId":"00000000-0000-0000-0000-000000000000","fileName":"imoveis.csv","columnMappings":[{"csvColumn":"Endereço","customFieldId":"00000000-0000-0000-0000-000000000000"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["bulk_update","bulk_delete","export","import"]},"state":{"type":"string","enum":["waiting","active","completed","failed"]},"progress":{"type":"number"},"total":{"type":"number"},"affected":{"type":["number","null"]},"fileName":{"type":["string","null"]},"downloadUrl":{"type":["string","null"]},"csv":{"type":["string","null"]},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"failedReason":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","kind","state","progress","total","affected","fileName","downloadUrl","csv","meta","failedReason","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_import_ai_mapping":{"post":{"operationId":"custom_objects.records_import_ai_mapping","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_import_ai_mapping.md"},"x-mcp-tool":"custom_objects_records_import_ai_mapping","x-cli":"node cli/atomiks.mjs custom_objects.records_import_ai_mapping --json '{...}'","x-session-only":false,"summary":"Sugerir o mapeamento das colunas da planilha com IA","description":"Equivale a `records/import/ai-suggest-mapping` do original. Manda o cabeçalho e até 5 linhas de exemplo ao modelo e devolve `suggestions` (`{csvColumn, customFieldId}`, um campo por coluna) e `uncertainColumns` (colunas em que a IA não teve certeza). Sem a chave da IA ou com falha, responde `aiFailed: true` com o motivo em `reason` e a tela usa o nome das colunas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"headers":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","maxLength":200}},"sampleRows":{"default":[],"maxItems":20,"type":"array","items":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":5000}}}},"required":["objectId","headers"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","headers":["Endereço","Preço"],"sampleRows":[["Rua A, 10","450000"]]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"csvColumn":{"type":"string"},"customFieldId":{"type":"string"}},"required":["csvColumn","customFieldId"],"additionalProperties":false}},"uncertainColumns":{"type":"array","items":{"type":"string"}},"aiFailed":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["suggestions","uncertainColumns","aiFailed","reason"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.records_import_ai_column":{"post":{"operationId":"custom_objects.records_import_ai_column","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.records_import_ai_column.md"},"x-mcp-tool":"custom_objects_records_import_ai_column","x-cli":"node cli/atomiks.mjs custom_objects.records_import_ai_column --json '{...}'","x-session-only":false,"summary":"Sugerir o campo de uma coluna da planilha com IA","description":"Equivale a `records/import/ai-suggest-column` do original (\"Sugerir campo com IA\" no mapeamento). Manda o nome da coluna e até 10 valores ao modelo e devolve até 3 `candidates` (`{customFieldId, confidence: high|medium|low, reason}`). Sem a chave da IA ou com falha, responde o erro `credencial_ausente` ou `internal` (a tela mostra \"Não foi possível analisar agora\").","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"header":{"type":"string","maxLength":200},"values":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","maxLength":5000}}},"required":["objectId","header"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000","header":"Preço","values":["450000","820000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"reason":{"type":["string","null"]}},"required":["customFieldId","confidence","reason"],"additionalProperties":false}}},"required":["candidates"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_job_get":{"post":{"operationId":"custom_objects.record_job_get","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_job_get.md"},"x-mcp-tool":"custom_objects_record_job_get","x-cli":"node cli/atomiks.mjs custom_objects.record_job_get --json '{...}'","x-session-only":false,"summary":"Ver uma tarefa de registros","description":"Estado de uma tarefa de registros (exportação, importação, alterar ou excluir em massa): `state` (waiting, active, completed, failed), `progress` (0 a 100), `total`, `affected`, contagens e erros por linha em `meta` e, na exportação concluída, um `downloadUrl` novo (vale 5 minutos). Equivale a `GET /custom-objects/records-bulk-jobs/{id}`; o original consulta de 2 em 2 segundos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["bulk_update","bulk_delete","export","import"]},"state":{"type":"string","enum":["waiting","active","completed","failed"]},"progress":{"type":"number"},"total":{"type":"number"},"affected":{"type":["number","null"]},"fileName":{"type":["string","null"]},"downloadUrl":{"type":["string","null"]},"csv":{"type":["string","null"]},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"failedReason":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","kind","state","progress","total","affected","fileName","downloadUrl","csv","meta","failedReason","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.record_jobs_list":{"post":{"operationId":"custom_objects.record_jobs_list","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.record_jobs_list.md"},"x-mcp-tool":"custom_objects_record_jobs_list","x-cli":"node cli/atomiks.mjs custom_objects.record_jobs_list --json '{...}'","x-session-only":false,"summary":"Listar tarefas de registros de um objeto","description":"As últimas 50 tarefas (exportações, importações e ações em massa) do objeto, da mais nova para a mais antiga. `kind` filtra.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["bulk_update","bulk_delete","export","import"]}},"required":["objectId"]},"example":{"objectId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["bulk_update","bulk_delete","export","import"]},"state":{"type":"string","enum":["waiting","active","completed","failed"]},"progress":{"type":"number"},"total":{"type":"number"},"affected":{"type":["number","null"]},"fileName":{"type":["string","null"]},"downloadUrl":{"type":["string","null"]},"csv":{"type":["string","null"]},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"failedReason":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","kind","state","progress","total","affected","fileName","downloadUrl","csv","meta","failedReason","createdAt","finishedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_objects.image_upload":{"post":{"operationId":"custom_objects.image_upload","tags":["custom_objects"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_objects.image_upload.md"},"x-mcp-tool":"custom_objects_image_upload","x-cli":"node cli/atomiks.mjs custom_objects.image_upload --json '{...}'","x-session-only":false,"summary":"Enviar foto de um registro","description":"Guarda uma imagem (JPEG, PNG, WebP ou GIF, até 10 MB; `content` em base64) e devolve `url`, o link para gravar num campo de tipo `image` (o link é assinado e vale 1 ano). O campo guarda uma lista de links (até 20); a primeira é a capa.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","minLength":1,"maxLength":100},"content":{"type":"string","minLength":1,"maxLength":14000000}},"required":["name","mimeType","content"]},"example":{"name":"fachada.png","mimeType":"image/png","content":"iVBORw0KGgo="}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.profile_wallet":{"post":{"operationId":"members.profile_wallet","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.profile_wallet.md"},"x-mcp-tool":"members_profile_wallet","x-cli":"node cli/atomiks.mjs members.profile_wallet --json '{...}'","x-session-only":false,"summary":"Carteira de uma pessoa (detalhe do membro)","description":"Oportunidades de que a pessoa é responsável: abertas (as 200 de maior valor, com o total), ganhas e perdidas desde `from` (até 200 de cada), cada uma com pipeline, etapa, contato, valor, chance, previsão de fechamento, origem, motivo da perda e a próxima tarefa aberta (`nextStep`). `leads` junta os contatos das oportunidades abertas. Dinheiro em centavos. Não traz temperatura do contato (o Atomiks não calcula por oportunidade).","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["userId","from"]},"example":{"userId":"00000000-0000-0000-0000-000000000000","from":"2026-09-26T00:00:00Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"openTotal":{"type":"number"},"open":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"stage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"valueCents":{"type":["number","null"]},"probability":{"type":["number","null"]},"expectedCloseDate":{"type":["string","null"]},"origin":{"type":["string","null"]},"lossReason":{"type":["string","null"]},"updatedAt":{"type":"string"},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"nextStep":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"}},"required":["title","dueAt","kind"],"additionalProperties":false},{"type":"null"}]}},"required":["id","title","contact","pipeline","stage","valueCents","probability","expectedCloseDate","origin","lossReason","updatedAt","wonAt","lostAt","nextStep"],"additionalProperties":false}},"won":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"stage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"valueCents":{"type":["number","null"]},"probability":{"type":["number","null"]},"expectedCloseDate":{"type":["string","null"]},"origin":{"type":["string","null"]},"lossReason":{"type":["string","null"]},"updatedAt":{"type":"string"},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"nextStep":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"}},"required":["title","dueAt","kind"],"additionalProperties":false},{"type":"null"}]}},"required":["id","title","contact","pipeline","stage","valueCents","probability","expectedCloseDate","origin","lossReason","updatedAt","wonAt","lostAt","nextStep"],"additionalProperties":false}},"lost":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"stage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"valueCents":{"type":["number","null"]},"probability":{"type":["number","null"]},"expectedCloseDate":{"type":["string","null"]},"origin":{"type":["string","null"]},"lossReason":{"type":["string","null"]},"updatedAt":{"type":"string"},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"nextStep":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"}},"required":["title","dueAt","kind"],"additionalProperties":false},{"type":"null"}]}},"required":["id","title","contact","pipeline","stage","valueCents","probability","expectedCloseDate","origin","lossReason","updatedAt","wonAt","lostAt","nextStep"],"additionalProperties":false}},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"deals":{"type":"array","items":{"type":"string"}}},"required":["id","name","deals"],"additionalProperties":false}}},"required":["openTotal","open","won","lost","leads"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.profile_service":{"post":{"operationId":"members.profile_service","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.profile_service.md"},"x-mcp-tool":"members_profile_service","x-cli":"node cli/atomiks.mjs members.profile_service --json '{...}'","x-session-only":false,"summary":"Atendimento de uma pessoa (detalhe do membro)","description":"Conversas atribuídas à pessoa: as 100 mais recentes (`items`, com status, não lidas, última mensagem e canal), o total e as contagens do período (`inPeriod`: com mensagem desde `from`; `assigned`: em atendimento agora; `resolved`: resolvidas desde `from`).","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["userId","from"]},"example":{"userId":"00000000-0000-0000-0000-000000000000","from":"2026-09-26T00:00:00Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contactName":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"channel":{"type":["string","null"]},"status":{"type":"string","enum":["open","assigned","resolved","closed"]},"unreadCount":{"type":"number"},"lastMessageAt":{"type":["string","null"]},"lastMessagePreview":{"type":["string","null"]},"lastInboundAt":{"type":["string","null"]}},"required":["id","contactName","contactPhone","channel","status","unreadCount","lastMessageAt","lastMessagePreview","lastInboundAt"],"additionalProperties":false}},"counts":{"type":"object","properties":{"inPeriod":{"type":"number"},"assigned":{"type":"number"},"resolved":{"type":"number"}},"required":["inPeriod","assigned","resolved"],"additionalProperties":false}},"required":["total","items","counts"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.profile_agenda":{"post":{"operationId":"members.profile_agenda","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.profile_agenda.md"},"x-mcp-tool":"members_profile_agenda","x-cli":"node cli/atomiks.mjs members.profile_agenda --json '{...}'","x-session-only":false,"summary":"Agenda de uma pessoa (detalhe do membro)","description":"Reuniões (tarefas do tipo meeting) e tarefas abertas da pessoa. `week`: reuniões com data entre `weekStart` e 7 dias depois; `period`: reuniões entre `from` e agora; `openTasks`: tarefas não concluídas que não são reunião, com o grupo (atrasada, hoje, próxima). Lê as 500 tarefas mais próximas da pessoa. O Atomiks não registra falta nem cancelamento de reunião: uma reunião é aberta ou concluída.","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"weekStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["userId","weekStart","from"]},"example":{"userId":"00000000-0000-0000-0000-000000000000","weekStart":"2026-10-26T00:00:00Z","from":"2026-09-26T00:00:00Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"week":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"meetingUrl":{"type":["string","null"]},"contactName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]}},"required":["id","title","kind","dueAt","done","durationMinutes","meetingUrl","contactName","opportunityId","bucket"],"additionalProperties":false}},"period":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"meetingUrl":{"type":["string","null"]},"contactName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]}},"required":["id","title","kind","dueAt","done","durationMinutes","meetingUrl","contactName","opportunityId","bucket"],"additionalProperties":false}},"openTasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["todo","call","message","meeting"]},"dueAt":{"type":["string","null"]},"done":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"meetingUrl":{"type":["string","null"]},"contactName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"bucket":{"type":"string","enum":["overdue","today","upcoming","no_date","done"]}},"required":["id","title","kind","dueAt","done","durationMinutes","meetingUrl","contactName","opportunityId","bucket"],"additionalProperties":false}}},"required":["week","period","openTasks"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.profile_builds":{"post":{"operationId":"members.profile_builds","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.profile_builds.md"},"x-mcp-tool":"members_profile_builds","x-cli":"node cli/atomiks.mjs members.profile_builds --json '{...}'","x-session-only":false,"summary":"O que a pessoa criou (detalhe do membro)","description":"Respostas rápidas (`quickReplies`, as 8 mais recentes e o total), arquivos enviados na caixa de entrada (`files`, com o total de bytes) e chaves de IA (`aiCredentials`) cadastrados pela pessoa. O original também conta metas e comentários em funis, que o Atomiks não tem; os modelos da Meta não guardam quem criou. Sem a migration de agentes de IA, `aiCredentials` vem vazio.","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]},"example":{"userId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quickReplies":{"type":"object","properties":{"total":{"type":"number"},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","updatedAt"],"additionalProperties":false}}},"required":["total","recent"],"additionalProperties":false},"files":{"type":"object","properties":{"total":{"type":"number"},"totalBytes":{"type":"number"},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sizeBytes":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","sizeBytes","createdAt"],"additionalProperties":false}}},"required":["total","totalBytes","recent"],"additionalProperties":false},"aiCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string"}},"required":["id","label","provider","status"],"additionalProperties":false}}},"required":["quickReplies","files","aiCredentials"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/members.profile_facts":{"post":{"operationId":"members.profile_facts","tags":["members"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/members.profile_facts.md"},"x-mcp-tool":"members_profile_facts","x-cli":"node cli/atomiks.mjs members.profile_facts --json '{...}'","x-session-only":false,"summary":"Telefone e quem convidou (detalhe do membro)","description":"Dados do cabeçalho do perfil que `members.list` não traz: `phone` (perfil da pessoa, ou null) e `invitedBy` (quem criou o convite, ou null). `id` é o de um membro ou o de um convite pendente. Para o membro, o convite é o último aceito com o mesmo e-mail; quem entrou como dono da conta, sem convite, volta com `invitedBy` null.","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"phone":{"type":["string","null"]},"invitedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["phone","invitedBy"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meetings.coaching_settings_get":{"post":{"operationId":"meetings.coaching_settings_get","tags":["meetings"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meetings.coaching_settings_get.md"},"x-mcp-tool":"meetings_coaching_settings_get","x-cli":"node cli/atomiks.mjs meetings.coaching_settings_get --json '{...}'","x-session-only":false,"summary":"Zonas-alvo e pesos da nota da avaliação de reunião","description":"Configuração de coaching de reunião da conta: `targets` (faixa mín./máx. por métrica; `fillerRatio` é razão de 0 a 1, `longestMonologueSeconds` em segundos) e `methodology.stages` (peso salvo e `defaultWeight` de cada etapa do método). Exige a chave de plano `messages.livechat-meetings` (senão forbidden). Sem configuração salva, devolve os padrões. Depende de uma migration; sem ela devolve os padrões.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targets":{"type":"object","properties":{"wordsPerMinute":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"fillerRatio":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"longestMonologueSeconds":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"nonInclusiveCount":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"questionsAsked":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"speakingPercent":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"activeListeningScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"sentimentScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["wordsPerMinute","fillerRatio","longestMonologueSeconds","nonInclusiveCount","questionsAsked","speakingPercent","activeListeningScore","sentimentScore"],"additionalProperties":false},"methodology":{"type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["rapport","situation","problem","implication","needPayoff","transition","presentation","commitment"]},"weight":{"type":"number"},"defaultWeight":{"type":"number"}},"required":["key","weight","defaultWeight"],"additionalProperties":false}}},"required":["stages"],"additionalProperties":false}},"required":["targets","methodology"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meetings.coaching_settings_set":{"post":{"operationId":"meetings.coaching_settings_set","tags":["meetings"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meetings.coaching_settings_set.md"},"x-mcp-tool":"meetings_coaching_settings_set","x-cli":"node cli/atomiks.mjs meetings.coaching_settings_set --json '{...}'","x-session-only":false,"summary":"Salvar zonas-alvo e pesos da nota da avaliação de reunião","description":"Admin. Grava `targets` (por métrica `{min?, max?}`; objeto vazio = sem limite; métrica omitida volta ao padrão) e `stageWeights` (peso >= 0 por etapa; zero desliga a etapa e pelo menos uma precisa ser maior que zero). Exige a chave de plano `messages.livechat-meetings`. Mínimo maior que o máximo responde invalid_input. Quem não é dono/administrador recebe forbidden. Depende de uma migration; sem ela responde migration_pendente.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targets":{"type":"object","properties":{"wordsPerMinute":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"fillerRatio":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"longestMonologueSeconds":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"nonInclusiveCount":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"questionsAsked":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"speakingPercent":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"activeListeningScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}},"sentimentScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}}}}},"stageWeights":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["rapport","situation","problem","implication","needPayoff","transition","presentation","commitment"]},"weight":{"type":"number","minimum":0}},"required":["key","weight"]}}},"required":["targets","stageWeights"]},"example":{"targets":{"wordsPerMinute":{"min":120,"max":185},"fillerRatio":{"max":0.05}},"stageWeights":[{"key":"rapport","weight":10},{"key":"situation","weight":15}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targets":{"type":"object","properties":{"wordsPerMinute":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"fillerRatio":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"longestMonologueSeconds":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"nonInclusiveCount":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"questionsAsked":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"speakingPercent":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"activeListeningScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},"sentimentScore":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false}},"required":["wordsPerMinute","fillerRatio","longestMonologueSeconds","nonInclusiveCount","questionsAsked","speakingPercent","activeListeningScore","sentimentScore"],"additionalProperties":false},"methodology":{"type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["rapport","situation","problem","implication","needPayoff","transition","presentation","commitment"]},"weight":{"type":"number"},"defaultWeight":{"type":"number"}},"required":["key","weight","defaultWeight"],"additionalProperties":false}}},"required":["stages"],"additionalProperties":false}},"required":["targets","methodology"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/meetings.coaching_targets_suggestion":{"post":{"operationId":"meetings.coaching_targets_suggestion","tags":["meetings"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/meetings.coaching_targets_suggestion.md"},"x-mcp-tool":"meetings_coaching_targets_suggestion","x-cli":"node cli/atomiks.mjs meetings.coaching_targets_suggestion --json '{...}'","x-session-only":false,"summary":"Faixas sugeridas pelas reuniões conduzidas","description":"Para cada métrica, o tamanho da amostra (`sampleSize`) nos últimos 30 dias e a faixa `suggested` (p25 a p75, só no lado que a métrica tem no padrão). Só sugere com `sampleSize >= minSamples`; senão `suggested` é null. `nonInclusiveCount` é zona fixa e não aparece. Exige a chave de plano `messages.livechat-meetings`. Lê os relatórios de reunião; sem eles devolve amostra 0.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"windowDays":{"type":"number"},"minSamples":{"type":"number"},"metrics":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["wordsPerMinute","fillerRatio","longestMonologueSeconds","nonInclusiveCount","questionsAsked","speakingPercent","activeListeningScore","sentimentScore"]},"sampleSize":{"type":"number"},"suggested":{"anyOf":[{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"additionalProperties":false},{"type":"null"}]}},"required":["key","sampleSize","suggested"],"additionalProperties":false}}},"required":["windowDays","minSamples","metrics"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.list":{"post":{"operationId":"email_inbox.list","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.list.md"},"x-mcp-tool":"email_inbox_list","x-cli":"node cli/atomiks.mjs email_inbox.list --json '{...}'","x-session-only":false,"summary":"Listar caixas de e-mail conectadas","description":"Caixas de e-mail (canal `email`) da conta, da mais antiga à mais nova, só as que o membro pode usar. Cada item é o \"canal\" do original: `status` (`pending` conexão incompleta, `live` ativa, `archived` desconectada), `emailAddress`, `emailLastSuccessAt`, `emailFailingSince` e `emailLastErrorCode` (quando a leitura está falhando, e por quê). Os arquivados só com `includeArchived`. Exige o módulo de plano `messages.email-inbox` (senão `forbidden`). Sem a migration, a lista vem vazia.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"includeArchived":{"default":false,"type":"boolean"}}},"example":{"includeArchived":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","const":"email"},"status":{"type":"string","enum":["pending","live","error","archived"]},"stableKey":{"type":"string"},"displayName":{"type":"string"},"emailAddress":{"type":"string"},"emailLastSuccessAt":{"type":["string","null"]},"emailFailingSince":{"type":["string","null"]},"emailLastErrorCode":{"type":["string","null"]},"profilePhotoUrl":{"type":"null"},"archivedAt":{"type":["string","null"]},"archivedReason":{"type":"null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channel","status","stableKey","displayName","emailAddress","emailLastSuccessAt","emailFailingSince","emailLastErrorCode","profilePhotoUrl","archivedAt","archivedReason","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.members":{"post":{"operationId":"email_inbox.members","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.members.md"},"x-mcp-tool":"email_inbox_members","x-cli":"node cli/atomiks.mjs email_inbox.members --json '{...}'","x-session-only":false,"summary":"Quem tem acesso a cada caixa de e-mail","description":"Para cada caixa de e-mail ativa da conta, as pessoas da conta e se podem usá-la: administradores sempre (`alwaysAllowed`, `seatRole` `admin`) e membros só se a caixa estiver liberada para eles em Configurações > Equipe (`hasAccess`; `channels` da permissão, `*` = todas). Traz nome e foto do perfil. `managementAccess` é sempre `false` (o Atomiks não separa gestão de uso). Só administrador (o `channels:manage` do original).","x-scope":"channels:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"channelInstanceId":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"name":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"seatRole":{"type":"string","enum":["admin","member"]},"alwaysAllowed":{"type":"boolean"},"hasAccess":{"type":"boolean"},"managementAccess":{"type":"boolean"}},"required":["personId","name","avatarUrl","seatRole","alwaysAllowed","hasAccess","managementAccess"],"additionalProperties":false}}},"required":["channelInstanceId","members"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.get":{"post":{"operationId":"email_inbox.get","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.get.md"},"x-mcp-tool":"email_inbox_get","x-cli":"node cli/atomiks.mjs email_inbox.get --json '{...}'","x-session-only":false,"summary":"Ver a configuração de uma caixa de e-mail","description":"Servidores IMAP e SMTP (host, porta, segurança, usuário), nome do remetente, assinatura (texto e logo), se a pasta Enviados é sincronizada, o estado da conexão (última leitura bem-sucedida, desde quando falha, código e texto do erro, falhas seguidas) e a importação de histórico (`historyImport`: desde quando, total, lidos, concluída em). A senha nunca é devolvida.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelInstanceId":{"type":"string"},"emailAddress":{"type":"string"},"imapHost":{"type":"string"},"imapPort":{"type":"number"},"imapSecure":{"type":"boolean"},"imapUsername":{"type":"string"},"smtpHost":{"type":"string"},"smtpPort":{"type":"number"},"smtpSecure":{"type":"boolean"},"smtpUsername":{"type":"string"},"lastSuccessAt":{"type":["string","null"]},"failingSince":{"type":["string","null"]},"lastErrorCode":{"type":["string","null"]},"lastError":{"type":["string","null"]},"consecutiveFailures":{"type":"number"},"fromName":{"type":["string","null"]},"syncSentFolder":{"type":"boolean"},"signatureText":{"type":["string","null"]},"signatureLogoUrl":{"type":["string","null"]},"historyImport":{"anyOf":[{"type":"object","properties":{"since":{"type":"string"},"total":{"type":["number","null"]},"processed":{"type":"number"},"completedAt":{"type":["string","null"]}},"required":["since","total","processed","completedAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["channelInstanceId","emailAddress","imapHost","imapPort","imapSecure","imapUsername","smtpHost","smtpPort","smtpSecure","smtpUsername","lastSuccessAt","failingSince","lastErrorCode","lastError","consecutiveFailures","fromName","syncSentFolder","signatureText","signatureLogoUrl","historyImport","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.preview":{"post":{"operationId":"email_inbox.preview","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.preview.md"},"x-mcp-tool":"email_inbox_preview","x-cli":"node cli/atomiks.mjs email_inbox.preview --json '{...}'","x-session-only":false,"summary":"Prévia de um e-mail com a assinatura","description":"Monta o HTML do e-mail como sairá: o `text` (aceita *negrito*, _itálico_, listas com \"- \" e links) seguido da assinatura da caixa. `signatureText` e `signatureLogoUrl` (https) testam uma assinatura ainda não salva; `null` tira a da caixa. Todo o HTML vem escapado.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","maxLength":20000},"signatureText":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"signatureLogoUrl":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["id","text"]},"example":{"id":"00000000-0000-0000-0000-000000000000","text":"Olá! Segue a resposta que você pediu."}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"html":{"type":"string"}},"required":["html"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.test_settings":{"post":{"operationId":"email_inbox.test_settings","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.test_settings.md"},"x-mcp-tool":"email_inbox_test_settings","x-cli":"node cli/atomiks.mjs email_inbox.test_settings --json '{...}'","x-session-only":false,"summary":"Testar as credenciais de uma caixa antes de conectar","description":"Abre uma conexão IMAP (recebimento) e uma SMTP (envio) com os dados informados e devolve o resultado de cada uma: `ok` ou `errorCode` (`auth_failed`, `host_not_found`, `connection_refused`, `tls_error`, `timeout`, `host_not_allowed`, `credential_unreadable`, `unknown`). Nada é salvo. Só servidores públicos de e-mail (rede interna dá `host_not_allowed`). Limite de 20 testes por conta a cada 10 minutos (`limit_reached`).","x-scope":"channels:write","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"emailAddress":{"type":"string","maxLength":254,"pattern":"^[^\\s@<>\"]+@[^\\s@<>\"]+\\.[^\\s@<>\"]{2,}$"},"imapHost":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$"},"imapPort":{"type":"integer","minimum":1,"maximum":65535},"imapSecure":{"type":"boolean"},"imapUsername":{"type":"string","minLength":1,"maxLength":254},"imapPassword":{"type":"string","minLength":1,"maxLength":1024},"smtpHost":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$"},"smtpPort":{"type":"integer","minimum":1,"maximum":65535},"smtpSecure":{"type":"boolean"},"smtpUsername":{"type":"string","minLength":1,"maxLength":254},"smtpPassword":{"type":"string","minLength":1,"maxLength":1024}},"required":["emailAddress","imapHost","imapPort","imapSecure","imapUsername","imapPassword","smtpHost","smtpPort","smtpSecure","smtpUsername","smtpPassword"]},"example":{"emailAddress":"comercial@empresa.com.br","imapHost":"imap.gmail.com","imapPort":993,"imapSecure":true,"imapUsername":"comercial@empresa.com.br","imapPassword":"senha-de-app","smtpHost":"smtp.gmail.com","smtpPort":465,"smtpSecure":true,"smtpUsername":"comercial@empresa.com.br","smtpPassword":"senha-de-app"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false},"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false}},"required":["imap","smtp"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.test":{"post":{"operationId":"email_inbox.test","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.test.md"},"x-mcp-tool":"email_inbox_test","x-cli":"node cli/atomiks.mjs email_inbox.test --json '{...}'","x-session-only":false,"summary":"Testar a conexão de uma caixa já conectada","description":"Testa o recebimento (IMAP) e o envio (SMTP) com as credenciais guardadas e devolve o resultado de cada um. O estado da caixa acompanha: sucesso limpa o \"falhando desde\"; falha o marca. Senha ilegível dá `credential_unreadable` nas duas pontas (informe a senha de novo em `email_inbox.update_credentials`).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false},"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false}},"required":["imap","smtp"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.update_credentials":{"post":{"operationId":"email_inbox.update_credentials","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.update_credentials.md"},"x-mcp-tool":"email_inbox_update_credentials","x-cli":"node cli/atomiks.mjs email_inbox.update_credentials --json '{...}'","x-session-only":false,"summary":"Trocar a senha de uma caixa de e-mail","description":"Testa a nova senha (recebimento e envio, com os servidores já salvos) e só então a guarda cifrada. Se o teste falhar nada é salvo e `saved` vem `false`, com o motivo em `result`. Ao salvar, o estado \"falhando\" é limpo e a leitura recomeça. A senha nunca volta.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"imapPassword":{"type":"string","minLength":1,"maxLength":1024},"smtpPassword":{"type":"string","minLength":1,"maxLength":1024}},"required":["id","imapPassword","smtpPassword"]},"example":{"id":"00000000-0000-0000-0000-000000000000","imapPassword":"nova-senha-de-app","smtpPassword":"nova-senha-de-app"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"type":"object","properties":{"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false},"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"errorCode":{"type":["string","null"]}},"required":["ok","errorCode"],"additionalProperties":false}},"required":["imap","smtp"],"additionalProperties":false},"saved":{"type":"boolean"}},"required":["result","saved"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.create":{"post":{"operationId":"email_inbox.create","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.create.md"},"x-mcp-tool":"email_inbox_create","x-cli":"node cli/atomiks.mjs email_inbox.create --json '{...}'","x-session-only":false,"summary":"Conectar uma caixa de e-mail","description":"Testa o recebimento (IMAP) e o envio (SMTP); se os dois passam, cria o canal `email` ativo e guarda as senhas cifradas. Falha no teste: `invalid_input` com `EMAIL_IMAP_FAILED:<código>` ou `EMAIL_SMTP_FAILED:<código>` e nada é criado. Caixa já conectada nesta conta: `limit_reached` com `CHANNEL_ALREADY_CONNECTED`; conectada em outra conta: `limit_reached` com `CHANNEL_HELD_ELSEWHERE`, e `confirmTakeover: true` desconecta a outra e move para cá. A leitura começa dali em diante (o que já estava na caixa só entra por `email_inbox.history_import`). Exige `TOKEN_ENC_KEY` no servidor (senão `credencial_ausente`) e a migration (senão `migration_pendente`).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"emailAddress":{"type":"string","maxLength":254,"pattern":"^[^\\s@<>\"]+@[^\\s@<>\"]+\\.[^\\s@<>\"]{2,}$"},"imapHost":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$"},"imapPort":{"type":"integer","minimum":1,"maximum":65535},"imapSecure":{"type":"boolean"},"imapUsername":{"type":"string","minLength":1,"maxLength":254},"imapPassword":{"type":"string","minLength":1,"maxLength":1024},"smtpHost":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$"},"smtpPort":{"type":"integer","minimum":1,"maximum":65535},"smtpSecure":{"type":"boolean"},"smtpUsername":{"type":"string","minLength":1,"maxLength":254},"smtpPassword":{"type":"string","minLength":1,"maxLength":1024},"confirmTakeover":{"default":false,"type":"boolean"}},"required":["emailAddress","imapHost","imapPort","imapSecure","imapUsername","imapPassword","smtpHost","smtpPort","smtpSecure","smtpUsername","smtpPassword"]},"example":{"emailAddress":"comercial@empresa.com.br","imapHost":"imap.gmail.com","imapPort":993,"imapSecure":true,"imapUsername":"comercial@empresa.com.br","imapPassword":"senha-de-app","smtpHost":"smtp.gmail.com","smtpPort":465,"smtpSecure":true,"smtpUsername":"comercial@empresa.com.br","smtpPassword":"senha-de-app","confirmTakeover":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channelInstanceId":{"type":"string"},"status":{"type":"string","const":"live"}},"required":["id","channelInstanceId","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.update_settings":{"post":{"operationId":"email_inbox.update_settings","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.update_settings.md"},"x-mcp-tool":"email_inbox_update_settings","x-cli":"node cli/atomiks.mjs email_inbox.update_settings --json '{...}'","x-session-only":false,"summary":"Ajustar o envio de uma caixa de e-mail","description":"Nome do remetente (`fromName`, até 120 caracteres; aparece antes do endereço nos e-mails enviados), assinatura (`signatureText` até 2000 caracteres, com *negrito*, _itálico_, listas \"- \" e links; `signatureLogoUrl` com https) e `syncSentFolder` (grava na conversa o que você envia direto pelo webmail ou celular para um contato com conversa aberta; vale só do momento em que liga). Só o que for enviado muda; `null` ou texto vazio limpa. Devolve a configuração (mesmo formato de `email_inbox.get`).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fromName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"syncSentFolder":{"type":"boolean"},"signatureText":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"signatureLogoUrl":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","fromName":"Ana da Loja Exemplo","syncSentFolder":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelInstanceId":{"type":"string"},"emailAddress":{"type":"string"},"imapHost":{"type":"string"},"imapPort":{"type":"number"},"imapSecure":{"type":"boolean"},"imapUsername":{"type":"string"},"smtpHost":{"type":"string"},"smtpPort":{"type":"number"},"smtpSecure":{"type":"boolean"},"smtpUsername":{"type":"string"},"lastSuccessAt":{"type":["string","null"]},"failingSince":{"type":["string","null"]},"lastErrorCode":{"type":["string","null"]},"lastError":{"type":["string","null"]},"consecutiveFailures":{"type":"number"},"fromName":{"type":["string","null"]},"syncSentFolder":{"type":"boolean"},"signatureText":{"type":["string","null"]},"signatureLogoUrl":{"type":["string","null"]},"historyImport":{"anyOf":[{"type":"object","properties":{"since":{"type":"string"},"total":{"type":["number","null"]},"processed":{"type":"number"},"completedAt":{"type":["string","null"]}},"required":["since","total","processed","completedAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["channelInstanceId","emailAddress","imapHost","imapPort","imapSecure","imapUsername","smtpHost","smtpPort","smtpSecure","smtpUsername","lastSuccessAt","failingSince","lastErrorCode","lastError","consecutiveFailures","fromName","syncSentFolder","signatureText","signatureLogoUrl","historyImport","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.history_import":{"post":{"operationId":"email_inbox.history_import","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.history_import.md"},"x-mcp-tool":"email_inbox_history_import","x-cli":"node cli/atomiks.mjs email_inbox.history_import --json '{...}'","x-session-only":false,"summary":"Importar o histórico de uma caixa de e-mail","description":"Pede a importação das conversas recentes que já estavam na caixa (`days`: 7 ou 30). O worker lê em segundo plano e acompanha em `historyImport` (`total`, `processed`, `completedAt`) de `email_inbox.get`. Os e-mails entram com a data original, sem não lida, sem janela e sem disparar automações. Uma vez por caixa: repetir dá `limit_reached` com `EMAIL_HISTORY_ALREADY_REQUESTED`. Inclui a pasta Enviados se `syncSentFolder` estiver ligado.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"days":{"anyOf":[{"type":"number","const":7},{"type":"number","const":30}]}},"required":["id","days"]},"example":{"id":"00000000-0000-0000-0000-000000000000","days":7}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelInstanceId":{"type":"string"},"emailAddress":{"type":"string"},"imapHost":{"type":"string"},"imapPort":{"type":"number"},"imapSecure":{"type":"boolean"},"imapUsername":{"type":"string"},"smtpHost":{"type":"string"},"smtpPort":{"type":"number"},"smtpSecure":{"type":"boolean"},"smtpUsername":{"type":"string"},"lastSuccessAt":{"type":["string","null"]},"failingSince":{"type":["string","null"]},"lastErrorCode":{"type":["string","null"]},"lastError":{"type":["string","null"]},"consecutiveFailures":{"type":"number"},"fromName":{"type":["string","null"]},"syncSentFolder":{"type":"boolean"},"signatureText":{"type":["string","null"]},"signatureLogoUrl":{"type":["string","null"]},"historyImport":{"anyOf":[{"type":"object","properties":{"since":{"type":"string"},"total":{"type":["number","null"]},"processed":{"type":"number"},"completedAt":{"type":["string","null"]}},"required":["since","total","processed","completedAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["channelInstanceId","emailAddress","imapHost","imapPort","imapSecure","imapUsername","smtpHost","smtpPort","smtpSecure","smtpUsername","lastSuccessAt","failingSince","lastErrorCode","lastError","consecutiveFailures","fromName","syncSentFolder","signatureText","signatureLogoUrl","historyImport","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.sync_now":{"post":{"operationId":"email_inbox.sync_now","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.sync_now.md"},"x-mcp-tool":"email_inbox_sync_now","x-cli":"node cli/atomiks.mjs email_inbox.sync_now --json '{...}'","x-session-only":false,"summary":"Ler a caixa de e-mail agora","description":"Faz uma rodada de leitura da caixa na hora (o worker faz isso a cada minuto) e devolve quantas mensagens novas entraram no atendimento e o estado do canal. Se o servidor de e-mail recusar, a caixa passa a \"falhando\" (`emailFailingSince`, `emailLastErrorCode`) e a resposta traz `failing: true`. `more: true` = ainda há mensagens para ler (chame de novo).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"imported":{"type":"number"},"more":{"type":"boolean"},"failing":{"type":"boolean"},"instance":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","const":"email"},"status":{"type":"string","enum":["pending","live","error","archived"]},"stableKey":{"type":"string"},"displayName":{"type":"string"},"emailAddress":{"type":"string"},"emailLastSuccessAt":{"type":["string","null"]},"emailFailingSince":{"type":["string","null"]},"emailLastErrorCode":{"type":["string","null"]},"profilePhotoUrl":{"type":"null"},"archivedAt":{"type":["string","null"]},"archivedReason":{"type":"null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","channel","status","stableKey","displayName","emailAddress","emailLastSuccessAt","emailFailingSince","emailLastErrorCode","profilePhotoUrl","archivedAt","archivedReason","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","imported","more","failing","instance"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.archive":{"post":{"operationId":"email_inbox.archive","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.archive.md"},"x-mcp-tool":"email_inbox_archive","x-cli":"node cli/atomiks.mjs email_inbox.archive --json '{...}'","x-session-only":false,"summary":"Desconectar uma caixa de e-mail","description":"Desconecta a caixa: o canal sai do ar, a leitura e o envio param e as senhas guardadas são apagadas. As conversas e mensagens continuam na conta. Para conectar de novo é preciso informar as credenciais (`email_inbox.create`).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.cancel":{"post":{"operationId":"email_inbox.cancel","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.cancel.md"},"x-mcp-tool":"email_inbox_cancel","x-cli":"node cli/atomiks.mjs email_inbox.cancel --json '{...}'","x-session-only":false,"summary":"Cancelar uma conexão de e-mail incompleta","description":"Descarta uma tentativa de conexão que não chegou a ficar ativa (`status` `pending`); nenhuma conversa é perdida. Caixa ativa responde `invalid_input` (use `email_inbox.archive`).","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/email_inbox.send":{"post":{"operationId":"email_inbox.send","tags":["email_inbox"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/email_inbox.send.md"},"x-mcp-tool":"email_inbox_send","x-cli":"node cli/atomiks.mjs email_inbox.send --json '{...}'","x-session-only":false,"summary":"Enviar um e-mail pela caixa conectada","description":"Envia pelo SMTP da caixa um e-mail para `to`, com `subject` (sem ele: \"Mensagem de <remetente>\") e `text` (aceita *negrito*, _itálico_, listas \"- \" e links), no formato da caixa: remetente com o nome configurado e a assinatura (texto e logo) no fim. A mensagem entra na conversa desse contato no atendimento (criada se não existir). `clientRequestId` (UUID) torna o envio idempotente. Se o servidor não confirmar, `uncertain: true` e nada é reenviado sozinho. Responder numa conversa que já existe também pode ser feito por `inbox.send`, que usa o mesmo envio. Exige acesso ao canal.","x-scope":"messages:send","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"to":{"type":"string","maxLength":254,"pattern":"^[^\\s@<>\"]+@[^\\s@<>\"]+\\.[^\\s@<>\"]{2,}$"},"subject":{"type":"string","maxLength":200},"text":{"type":"string","minLength":1,"maxLength":20000},"clientRequestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","to","text"]},"example":{"id":"00000000-0000-0000-0000-000000000000","to":"cliente@exemplo.com.br","subject":"Sua proposta","text":"Olá! Segue a proposta."}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"uncertain":{"type":"boolean"}},"required":["id","conversationId","uncertain"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.list":{"post":{"operationId":"activities.list","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.list.md"},"x-mcp-tool":"activities_list","x-cli":"node cli/atomiks.mjs activities.list --json '{...}'","x-session-only":false,"summary":"Histórico global de atividades","description":"Atividades de todos os contatos que quem pede enxerga, do mais recente para o mais antigo, com os filtros do Histórico de atividades do Clickmax. Cada item traz `eventName` (nome do evento no original, como `crm.tag.lead.apply.v1`), `name`, `category` (Checkout, Email, Chat, Tag, Lead, Opportunity, PageView, Cart, PaymentFailedOrExpired ou MemberArea), `leadId`/`leadName`, `opportunityId`, `leadTaskId`, `messageId`, quem fez (`actorType`, `actorId`, `actorName`) e `meta` com os detalhes do tipo (tag, etapa, valor, produto, texto da mensagem…).\n\nFiltros (E entre eles; dentro de cada lista, qualquer valor): `eventName`, `startDate`/`endDate` (AAAA-MM-DD ou ISO; dia sem hora vale o dia inteiro em UTC), `tagIds`, `pipelineIds`, `flowIds`, `productIds`. `offerIds`, `pageIds`, `funnelIds` e `messageIds` existem no original e não têm fonte aqui: com algum valor a lista vem vazia. `leadId` limita a um contato (precisa estar visível, senão `not_found`).\n\nPaginação como o original: `page` (de 1) e `perPage` (50, até 100); `meta.countItens` é o total (\"N atividades no total\") e `meta.countPages` as páginas. Só as 5 000 mais recentes de cada fonte ficam ao alcance de páginas fundas: acima disso `data` vem vazio e `countPages` para antes; filtre por período para chegar mais longe. `timezone` é o fuso da conta, para agrupar por dia. Ao vivo: repita `page: 1, perPage: 50` a cada 5 segundos.\n\nFontes: mensagens e notas internas, atendimentos, compras e cancelamentos, oportunidades (criada, ganha, perdida), tarefas, consentimentos de envio, execuções de automação (flows e Instagram) e eventos de domínio (etiquetas, campos, etapas, vendas de integrações, carrinho, assinatura, comentários do Instagram). Tipos do original sem fonte aqui (e-mail, campanha, voz, Telegram, páginas, área de membros do original, leitura da conversa por IA…) aparecem em `activities.filter_options` com `hasSource: false`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventName":{"maxItems":400,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"startDate":{"type":"string","maxLength":40},"endDate":{"type":"string","maxLength":40},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"pageIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"tagIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"messageIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"pipelineIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"flowIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"startDate":"2026-10-01","eventName":["crm.tag.lead.apply.v1"],"page":1,"perPage":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventName":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"createdAt":{"type":"string"},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"leadTaskId":{"type":["string","null"]},"objectRecordId":{"type":["string","null"]},"messageId":{"type":["string","null"]},"aggregateId":{"type":["string","null"]},"actorType":{"anyOf":[{"type":"string","enum":["user","flow","automation","ai","api","system"]},{"type":"null"}]},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"meta":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","eventName","name","category","createdAt","leadId","leadName","opportunityId","leadTaskId","objectRecordId","messageId","aggregateId","actorType","actorId","actorName","meta"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false},"timezone":{"type":"string"}},"required":["data","meta","timezone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.filter_options":{"post":{"operationId":"activities.filter_options","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.filter_options.md"},"x-mcp-tool":"activities_filter_options","x-cli":"node cli/atomiks.mjs activities.filter_options --json '{...}'","x-session-only":false,"summary":"Opções dos filtros do histórico global","description":"O que os filtros de dimensão de `activities.list` aceitam no período (`startDate`/`endDate`, opcionais): `products`, `tags`, `pipelines` e `flows` com `id`, `name` e `count` (atividades no período); `offers`, `pages`, `funnels` e `messages` vêm vazias (sem fonte). `events` é o catálogo do filtro de tipo: `eventName`, `label` em português, `category` e `hasSource` (false = o Clickmax original tem o tipo e o Atomiks ainda não grava atividade dele).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"startDate":{"type":"string","maxLength":40},"endDate":{"type":"string","maxLength":40}}},"example":{"startDate":"2026-10-01","endDate":"2026-10-26"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"funnels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"flows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["id","name","count"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"},"hasSource":{"type":"boolean"}},"required":["eventName","label","category","hasSource"],"additionalProperties":false}},"timezone":{"type":"string"}},"required":["offers","pages","funnels","products","tags","messages","pipelines","flows","events","timezone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.stats":{"post":{"operationId":"activities.stats","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.stats.md"},"x-mcp-tool":"activities_stats","x-cli":"node cli/atomiks.mjs activities.stats --json '{...}'","x-session-only":false,"summary":"Estatísticas do histórico global","description":"Barra lateral do Histórico de atividades: `byCategory` (por categoria), `topLeads` (5 contatos mais ativos), `topEventTypes` (5 tipos mais frequentes) e `byHour` (volume por hora do dia, no fuso da conta; só horas com atividade). Sem `startDate`/`endDate`, os últimos 30 dias. Conta até as 2 000 atividades mais recentes de cada fonte no período.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"startDate":{"type":"string","maxLength":40},"endDate":{"type":"string","maxLength":40}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"byCategory":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"number"}},"required":["category","count"],"additionalProperties":false}},"topLeads":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"leadName":{"type":"string"},"count":{"type":"number"}},"required":["leadId","leadName","count"],"additionalProperties":false}},"topEventTypes":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"count":{"type":"number"}},"required":["eventName","count"],"additionalProperties":false}},"byHour":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"count":{"type":"number"}},"required":["hour","count"],"additionalProperties":false}}},"required":["byCategory","topLeads","topEventTypes","byHour"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.export":{"post":{"operationId":"activities.export","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.export.md"},"x-mcp-tool":"activities_export","x-cli":"node cli/atomiks.mjs activities.export --json '{...}'","x-session-only":false,"summary":"Exportar o histórico global em CSV","description":"Enfileira um CSV (UTF-8 com BOM, vírgula, até 50 000 atividades) com os mesmos filtros de `activities.list`. Roda em segundo plano com as permissões de quem pediu. `labels` (opcional) traz o rótulo de cada `eventName` no idioma da tela; sem ele sai o rótulo em português. Colunas: `data`, `hora` (fuso da conta), `contato`, `atividade`, `evento`, `categoria`, `responsavel`, `detalhes`. Devolve `jobId`; acompanhe e baixe por `activities.export_get`. Sem a migration do job, responde `migration_pendente`.","x-scope":"crm:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventName":{"maxItems":400,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"startDate":{"type":"string","maxLength":40},"endDate":{"type":"string","maxLength":40},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"pageIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"tagIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"messageIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"pipelineIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"flowIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"labels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":200}}}},"example":{"startDate":"2026-10-01","endDate":"2026-10-26"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"count":{"type":"number"}},"required":["jobId","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.export_get":{"post":{"operationId":"activities.export_get","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.export_get.md"},"x-mcp-tool":"activities_export_get","x-cli":"node cli/atomiks.mjs activities.export_get --json '{...}'","x-session-only":false,"summary":"Ver uma exportação do histórico global","description":"Status do job de `activities.export` (`queued`, `running`, `done`, `failed`), atividades no arquivo e, quando pronto, `url` assinada (vale 5 minutos; chame de novo para outra). O arquivo fica 24 horas; depois `url` volta `null` com `expired: true`. Quem pediu vê a sua; admin vê todas da conta.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["jobId"]},"example":{"jobId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"url":{"type":["string","null"]},"count":{"type":"number"},"expired":{"type":"boolean"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["jobId","status","url","count","expired","error","createdAt","finishedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.message_detail":{"post":{"operationId":"activities.message_detail","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.message_detail.md"},"x-mcp-tool":"activities_message_detail","x-cli":"node cli/atomiks.mjs activities.message_detail --json '{...}'","x-session-only":false,"summary":"Detalhe da mensagem de uma atividade","description":"Detalhe da mensagem de uma atividade de conversa (`activityId` = `id` da atividade): `channel`, `deliveryStatus` (queued, sent, delivered, visualized ou failed; só em mensagem enviada), `deliveryError`, `subject`, `contents` ([{format, content, fileName, caption}]) e, quando a mensagem saiu de uma automação ou disparo, `flow`/`broadcast` (o Atomiks não guarda essa origem: sempre `null`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"activityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["activityId"]},"example":{"activityId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channel":{"type":["string","null"]},"deliveryStatus":{"type":["string","null"]},"deliveryError":{"type":["string","null"]},"subject":{"type":["string","null"]},"contents":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"content":{"type":"string"},"fileName":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["format","content","fileName","caption"],"additionalProperties":false}},"flow":{"type":"null"},"broadcast":{"type":"null"}},"required":["channel","deliveryStatus","deliveryError","subject","contents","flow","broadcast"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.message_leads":{"post":{"operationId":"activities.message_leads","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.message_leads.md"},"x-mcp-tool":"activities_message_leads","x-cli":"node cli/atomiks.mjs activities.message_leads --json '{...}'","x-session-only":false,"summary":"Contatos com mensagens (Registro de mensagens)","description":"Lista da aba \"Registro de mensagens\": um item por contato com conversa, do mais recente, com `lastPlatform` (whatsapp, evolution ou instagram), `lastMessageName` (prévia da última mensagem) e `lastMessageAt`. `platform` filtra pelo canal (e-mail, SMS, Telegram e voz do original não existem aqui: lista vazia); `search` busca por nome, e-mail ou telefone, sem acento. Lê as 2 000 conversas mais recentes. Página de 20 por padrão.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100},"platform":{"type":"string","maxLength":40},"search":{"type":"string","maxLength":120}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"leadName":{"type":["string","null"]},"leadEmail":{"type":["string","null"]},"leadTelephone":{"type":["string","null"]},"lastPlatform":{"type":"string"},"lastMessageName":{"type":["string","null"]},"lastMessageAt":{"type":"string"}},"required":["leadId","leadName","leadEmail","leadTelephone","lastPlatform","lastMessageName","lastMessageAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities.message_thread":{"post":{"operationId":"activities.message_thread","tags":["activities"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities.message_thread.md"},"x-mcp-tool":"activities_message_thread","x-cli":"node cli/atomiks.mjs activities.message_thread --json '{...}'","x-session-only":false,"summary":"Mensagens enviadas a um contato","description":"Mensagens enviadas ao contato (mais recente primeiro), uma por item: `instanceId` (id da mensagem), `platform`, `status` (queued, sent, delivered, visualized, failed), `queuedAt`, `contents` ([{id, order, format, content, fileName, caption}]) e `error`. `emailSubject`, `messageName` e `creditCost` existem no original e ficam `null`. O contato precisa estar visível (`not_found` se não). Página de 200 por padrão, até 500.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":500},"platform":{"type":"string","maxLength":40}},"required":["leadId"]},"example":{"leadId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string"},"platform":{"type":"string"},"status":{"type":"string"},"queuedAt":{"type":"string"},"contents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"},"format":{"type":"string"},"content":{"type":"string"},"fileName":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","order","format","content","fileName","caption"],"additionalProperties":false}},"emailSubject":{"type":"null"},"messageName":{"type":"null"},"error":{"type":["string","null"]},"creditCost":{"type":"null"}},"required":["instanceId","platform","status","queuedAt","contents","emailSubject","messageName","error","creditCost"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.overview":{"post":{"operationId":"sales.overview","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.overview.md"},"x-mcp-tool":"sales_overview","x-cli":"node cli/atomiks.mjs sales.overview --json '{...}'","x-session-only":false,"summary":"Cartões de vendas do Atomiks","description":"Totais da aba \"Vendas via Atomiks\" com os filtros da tela: receita (`totalSales`, só vendas ativas), total de transações e aprovadas, compradores, valor a recuperar (vendas canceladas, uma vez por comprador e produto) e a origem das compras (`utmSourceBreakdown`). Faturas, falhas, reembolsos, PIX/boleto em aberto e abandono de carrinho não existem nas vendas do Atomiks e vêm zerados.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totalSales":{"type":"number"},"totalSalesNetValue":{"type":"number"},"totalNumberOfSales":{"type":"number"},"totalNumberOfSalesPaid":{"type":"number"},"totalNumberOfInvoices":{"type":"number"},"totalSalesInvoices":{"type":"number"},"totalNumberOfInvoicesPaid":{"type":"number"},"totalNumberOfSalesFailed":{"type":"number"},"totalValueFailed":{"type":"number"},"totalNumberOfSalesRefunded":{"type":"number"},"totalSalesRefunded":{"type":"number"},"totalNumberOfPixPending":{"type":"number"},"totalNumberOfBoletoPending":{"type":"number"},"totalNumberOfCartAbandonment":{"type":"number"},"totalNumberOfBuyers":{"type":"number"},"recovery":{"type":"object","properties":{"totalValue":{"type":"number"},"totalItems":{"type":"number"}},"required":["totalValue","totalItems"],"additionalProperties":false},"utmSourceBreakdown":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"count":{"type":"number"}},"required":["source","count"],"additionalProperties":false}},"failedReasonBreakdown":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"],"additionalProperties":false}}},"required":["totalSales","totalSalesNetValue","totalNumberOfSales","totalNumberOfSalesPaid","totalNumberOfInvoices","totalSalesInvoices","totalNumberOfInvoicesPaid","totalNumberOfSalesFailed","totalValueFailed","totalNumberOfSalesRefunded","totalSalesRefunded","totalNumberOfPixPending","totalNumberOfBoletoPending","totalNumberOfCartAbandonment","totalNumberOfBuyers","recovery","utmSourceBreakdown","failedReasonBreakdown"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.list":{"post":{"operationId":"sales.list","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.list.md"},"x-mcp-tool":"sales_list","x-cli":"node cli/atomiks.mjs sales.list --json '{...}'","x-session-only":false,"summary":"Listar vendas do Atomiks (tabela de vendas)","description":"Vendas do Atomiks (registradas à mão ou pela mensagem) com comprador, produto, valor e situação (`paid` enquanto ativa, `canceled` depois de cancelada), ordenadas por `column` (createdAt, buyerName, status ou gateway) e `order`. Paginação: `page` e `perPage` (50, até 100).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100},"column":{"type":"string","enum":["createdAt","buyerName","status","cxFeeFix","cxFeePercentage","installments","gateway","type"]},"order":{"type":"string","enum":["asc","desc"]}}},"example":{"page":1,"perPage":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"shortenCode":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},"orderStatus":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},"buyer":{"type":"object","properties":{"leadId":{"type":["string","null"]},"name":{"type":"string"},"email":{"type":"string"}},"required":["leadId","name","email"],"additionalProperties":false},"paymentMethod":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"product":{"type":"string"},"offer":{"type":"string"},"createdAt":{"type":"string"},"role":{"anyOf":[{"type":"string","enum":["producer","affiliate","coproducer"]},{"type":"null"}]},"saleValue":{"type":"number"},"mainOfferPrice":{"type":"number"},"commission":{"type":"number"},"gateway":{"type":["string","null"]},"currency":{"type":"string"}},"required":["code","shortenCode","externalId","status","orderStatus","buyer","paymentMethod","product","offer","createdAt","role","saleValue","mainOfferPrice","commission","gateway","currency"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.chart":{"post":{"operationId":"sales.chart","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.chart.md"},"x-mcp-tool":"sales_chart","x-cli":"node cli/atomiks.mjs sales.chart --json '{...}'","x-session-only":false,"summary":"Gráfico de vendas do Atomiks","description":"Receita (centavos) e número de vendas aprovadas por dia, semana ISO ou mês (`period`), no fuso da conta, entre `from` e `to`. Só vêm os períodos com venda.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","enum":["daily","weekly","monthly"]},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}},"required":["from","to","period"]},"example":{"from":"2026-10-01T00:00:00.000Z","to":"2026-10-26T23:59:59.999Z","period":"daily"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revenueData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"revenue":{"type":"number"}},"required":["period","label","revenue"],"additionalProperties":false}},"purchasesData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"purchases":{"type":"number"},"invoices":{"type":"number"}},"required":["period","label","purchases","invoices"],"additionalProperties":false}}},"required":["revenueData","purchasesData"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.get":{"post":{"operationId":"sales.get","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.get.md"},"x-mcp-tool":"sales_get","x-cli":"node cli/atomiks.mjs sales.get --json '{...}'","x-session-only":false,"summary":"Detalhe da venda","description":"Venda do Atomiks (`id` uuid) ou pedido de plataforma (`id` = código do pedido): situação, datas, pagamento, produto e transações. O Atomiks não cobra taxa nem parcela e não guarda garantia: esses campos vêm zerados ou nulos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"shortenCode":{"type":"string"},"orderStatus":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},"isSubscriptionInvoice":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"details":{"type":"object","properties":{"currency":{"type":"string"},"approvedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"cancelledAt":{"type":["string","null"]}},"required":["currency","approvedAt","createdAt","cancelledAt"],"additionalProperties":false},"warranty":{"anyOf":[{"type":"object","properties":{"approvalDate":{"type":["string","null"]},"warrantyPeriodDays":{"type":"number"},"warrantyStatus":{"type":"string"}},"required":["approvalDate","warrantyPeriodDays","warrantyStatus"],"additionalProperties":false},{"type":"null"}]},"payment":{"type":"object","properties":{"method":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"totalPaidByBuyer":{"type":"number"},"passPlatformFee":{"type":"boolean"},"membershipFee":{"type":"number"},"offerPrice":{"type":"number"},"discountAmount":{"type":"number"},"baseValueForCommission":{"type":"number"},"extraServices":{"type":"number"},"installments":{"type":["number","null"]},"installmentValue":{"type":["number","null"]},"clickmaxFee":{"type":"number"},"cxFeePercentage":{"type":"number"},"cxFeeFix":{"type":"number"},"yourCommission":{"type":"number"},"interest":{"type":"number"}},"required":["method","totalPaidByBuyer","passPlatformFee","membershipFee","offerPrice","discountAmount","baseValueForCommission","extraServices","installments","installmentValue","clickmaxFee","cxFeePercentage","cxFeeFix","yourCommission","interest"],"additionalProperties":false},"product":{"type":"object","properties":{"name":{"type":"string"},"offer":{"type":"string"},"producer":{"type":["string","null"]},"price":{"type":"number"},"offerTypeIsRecurrent":{"type":"boolean"},"approvalDate":{"type":["string","null"]}},"required":["name","offer","producer","price","offerTypeIsRecurrent","approvalDate"],"additionalProperties":false},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["main","bump"]},"shortenCode":{"type":"string"},"product":{"type":"string"},"offer":{"type":"string"},"value":{"type":"number"},"status":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},"paymentMethod":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","type","shortenCode","product","offer","value","status","paymentMethod","createdAt"],"additionalProperties":false}}},"required":["id","externalId","shortenCode","orderStatus","isSubscriptionInvoice","subscriptionId","details","warranty","payment","product","transactions"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.buyer":{"post":{"operationId":"sales.buyer","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.buyer.md"},"x-mcp-tool":"sales_buyer","x-cli":"node cli/atomiks.mjs sales.buyer --json '{...}'","x-session-only":false,"summary":"Dados do comprador da venda","description":"Nome, e-mail, telefone (separado em DDI, DDD e número), documento e endereço do contato da venda.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"leadId":{"type":["string","null"]},"document":{"type":["string","null"]},"telephone":{"anyOf":[{"type":"object","properties":{"countryCode":{"type":["string","null"]},"areaCode":{"type":["string","null"]},"number":{"type":["string","null"]}},"required":["countryCode","areaCode","number"],"additionalProperties":false},{"type":"null"}]}},"required":["name","email","leadId","document","telephone"],"additionalProperties":false},"address":{"type":"object","properties":{"country":{"type":["string","null"]},"complement":{"type":["string","null"]},"state":{"type":["string","null"]},"street":{"type":["string","null"]},"neighborhood":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"number":{"type":["string","null"]},"city":{"type":["string","null"]}},"required":["country","complement","state","street","neighborhood","zipCode","number","city"],"additionalProperties":false}},"required":["buyer","address"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.utms":{"post":{"operationId":"sales.utms","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.utms.md"},"x-mcp-tool":"sales_utms","x-cli":"node cli/atomiks.mjs sales.utms --json '{...}'","x-session-only":false,"summary":"Rastreamento (UTMs) da venda","description":"UTMs, `src` e `sck` da venda. Vendas do Atomiks usam a origem de anúncio do contato; pedidos de plataforma trazem os parâmetros que a plataforma enviou.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"utms":{"type":"object","properties":{"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"utmContent":{"type":["string","null"]},"utmTerm":{"type":["string","null"]},"src":{"type":["string","null"]},"sck":{"type":["string","null"]}},"required":["utmSource","utmMedium","utmCampaign","utmContent","utmTerm","src","sck"],"additionalProperties":false}},"required":["utms"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.by_reference":{"post":{"operationId":"sales.by_reference","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.by_reference.md"},"x-mcp-tool":"sales_by_reference","x-cli":"node cli/atomiks.mjs sales.by_reference --json '{...}'","x-session-only":false,"summary":"Achar a venda pela referência","description":"Devolve o `id` do pedido de plataforma com o código `externalId` (a tela abre o detalhe dele). `not_found` se nenhum pedido tem esse código.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200}},"required":["externalId"]},"example":{"externalId":"HP12345678"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.external_list":{"post":{"operationId":"sales.external_list","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.external_list.md"},"x-mcp-tool":"sales_external_list","x-cli":"node cli/atomiks.mjs sales.external_list --json '{...}'","x-session-only":false,"summary":"Listar vendas de plataformas externas","description":"Último estado de cada pedido recebido por integração (Hotmart, Kiwify...), com comprador, produto, código da oferta, valor, moeda, gateway, método e referência. `column`: value, createdAt, updatedAt, productName, method, leadName, installments, gatewayOrigin ou offerCode.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100},"column":{"type":"string","enum":["value","createdAt","updatedAt","productName","method","leadName","installments","gatewayOrigin","offerCode"]},"order":{"type":"string","enum":["asc","desc"]}}},"example":{"page":1,"perPage":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"status":{"anyOf":[{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"origin":{"type":["string","null"]}},"required":["id","name","email","origin"],"additionalProperties":false},{"type":"null"}]},"shortenId":{"type":["string","null"]},"productName":{"type":["string","null"]},"offerCode":{"type":["string","null"]},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"gatewayOrigin":{"type":["string","null"]},"method":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"externalId":{"type":["string","null"]},"externalPageUrl":{"type":["string","null"]},"page":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]}},"required":["name"],"additionalProperties":false},{"type":"null"}]},"installments":{"type":["number","null"]},"couponCode":{"type":["string","null"]},"orderBumps":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}},"required":["id","createdAt","status","lead","shortenId","productName","offerCode","value","currency","gatewayOrigin","method","externalId","externalPageUrl","page","installments","couponCode","orderBumps"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.external_overview":{"post":{"operationId":"sales.external_overview","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.external_overview.md"},"x-mcp-tool":"sales_external_overview","x-cli":"node cli/atomiks.mjs sales.external_overview --json '{...}'","x-session-only":false,"summary":"Cartões de vendas de plataformas externas","description":"Receita, compradores, ticket médio por comprador e vendas por canal dos pedidos aprovados, na moeda escolhida em `filters.currency` (ou a de maior receita). `currency` vem nulo sem vendas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"aggregations":{"type":"object","properties":{"currency":{"type":["string","null"]},"totalRevenue":{"type":"number"},"totalNumberOfBuyers":{"type":"number"},"averageTicketPerBuyer":{"type":"number"},"totalSales":{"type":"number"},"revenueByCurrency":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"revenue":{"type":"number"}},"required":["currency","revenue"],"additionalProperties":false}},"channelAggregations":{"type":"array","items":{"type":"object","properties":{"gateway":{"type":"string"},"revenue":{"type":"number"},"buyers":{"type":"number"}},"required":["gateway","revenue","buyers"],"additionalProperties":false}}},"required":["currency","totalRevenue","totalNumberOfBuyers","averageTicketPerBuyer","totalSales","revenueByCurrency","channelAggregations"],"additionalProperties":false}},"required":["aggregations"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.external_chart":{"post":{"operationId":"sales.external_chart","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.external_chart.md"},"x-mcp-tool":"sales_external_chart","x-cli":"node cli/atomiks.mjs sales.external_chart --json '{...}'","x-session-only":false,"summary":"Gráfico de vendas de plataformas externas","description":"Receita (centavos) e número de vendas aprovadas por dia, semana ISO ou mês (`period`), no fuso da conta, entre `from` e `to`. Só vêm os períodos com venda.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","enum":["daily","weekly","monthly"]},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}},"required":["from","to","period"]},"example":{"from":"2026-10-01T00:00:00.000Z","to":"2026-10-26T23:59:59.999Z","period":"daily"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revenueData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"revenue":{"type":"number"}},"required":["period","label","revenue"],"additionalProperties":false}},"purchasesData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"purchases":{"type":"number"},"invoices":{"type":"number"}},"required":["period","label","purchases","invoices"],"additionalProperties":false}}},"required":["revenueData","purchasesData"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.autocomplete_products":{"post":{"operationId":"sales.autocomplete_products","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.autocomplete_products.md"},"x-mcp-tool":"sales_autocomplete_products","x-cli":"node cli/atomiks.mjs sales.autocomplete_products --json '{...}'","x-session-only":false,"summary":"Produtos para o filtro de vendas","description":"Produtos das plataformas externas (`scope: \"external\"`) ou do Atomiks, filtrados por `searchText`. `id` é o que o filtro `productIds` espera.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"searchText":{"type":"string","maxLength":120},"scope":{"type":"string","enum":["atomiks","external"]}}},"example":{"searchText":"curso"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.autocomplete_utms":{"post":{"operationId":"sales.autocomplete_utms","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.autocomplete_utms.md"},"x-mcp-tool":"sales_autocomplete_utms","x-cli":"node cli/atomiks.mjs sales.autocomplete_utms --json '{...}'","x-session-only":false,"summary":"UTMs vistos nas vendas","description":"Valores distintos de UTM (source, medium, campaign, content, term) e de `src`/`sck` das vendas e pedidos da conta, para o filtro \"Origem das compras\".","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"utmSource":{"type":"array","items":{"type":"string"}},"utmMedium":{"type":"array","items":{"type":"string"}},"utmCampaign":{"type":"array","items":{"type":"string"}},"utmContent":{"type":"array","items":{"type":"string"}},"utmTerm":{"type":"array","items":{"type":"string"}},"src":{"type":"array","items":{"type":"string"}},"sck":{"type":"array","items":{"type":"string"}}},"required":["utmSource","utmMedium","utmCampaign","utmContent","utmTerm","src","sck"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales.export_csv":{"post":{"operationId":"sales.export_csv","tags":["sales"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales.export_csv.md"},"x-mcp-tool":"sales_export_csv","x-cli":"node cli/atomiks.mjs sales.export_csv --json '{...}'","x-session-only":false,"summary":"Exportar vendas em CSV","description":"Texto CSV (separador \";\") das vendas com os filtros da tela, da aba `clickmax` ou `external` (até 20000 linhas), na ordem de `column`/`order`. A tela baixa como `sales.csv`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tab":{"type":"string","enum":["clickmax","external"]},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"column":{"type":"string","maxLength":40},"order":{"type":"string","enum":["asc","desc"]},"viewMode":{"type":"string","enum":["by-sale","by-transaction"]}},"required":["tab"]},"example":{"tab":"clickmax"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications.prefs_get":{"post":{"operationId":"notifications.prefs_get","tags":["notifications"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/notifications.prefs_get.md"},"x-mcp-tool":"notifications_prefs_get","x-cli":"node cli/atomiks.mjs notifications.prefs_get --json '{...}'","x-session-only":false,"summary":"Ver minhas preferências de notificação","description":"Matriz de Configurações > Notificações: chave geral por canal (`general`: `inApp` no app, `mobilePush` push no celular) e, por categoria, cada tipo de aviso com seu valor em cada canal. Canal `null`: o aviso não sai por ele (chave inativa). Chave geral desligada: nenhum aviso sai pelo canal. Valem em todas as contas.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"general":{"type":"object","properties":{"inApp":{"type":"boolean"},"mobilePush":{"type":"boolean"}},"required":["inApp","mobilePush"],"additionalProperties":false},"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"kinds":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"inApp":{"type":["boolean","null"]},"mobilePush":{"type":["boolean","null"]}},"required":["kind","label","description","inApp","mobilePush"],"additionalProperties":false}}},"required":["key","title","kinds"],"additionalProperties":false}}},"required":["general","categories"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications.prefs_set":{"post":{"operationId":"notifications.prefs_set","tags":["notifications"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/notifications.prefs_set.md"},"x-mcp-tool":"notifications_prefs_set","x-cli":"node cli/atomiks.mjs notifications.prefs_set --json '{...}'","x-session-only":false,"summary":"Alterar uma preferência de notificação","description":"Liga ou desliga um canal (`inApp` ou `mobilePush`) para um tipo de aviso, ou para todos (`kind` = `ALL`). Tipos: PURCHASE_COMPLETED, PIX_EXPIRED, TRIAL_STARTED, PAYMENT_GENERATED, OPPORTUNITY_CREATED, OPPORTUNITY_WON, OPPORTUNITY_LOST, OPPORTUNITY_ASSIGNED, OPPORTUNITY_SLA_BREACHED, FLOWS_PAUSED_CHANNEL_DOWN, FLOWS_RESUMED, FLOW_RESUME_REQUIRED, FLOW_RUN_FAILED, FLOW_RUN_AT_RISK, DOMAIN_CONNECTED, DOMAIN_MIGRATION_NEEDED, DOMAIN_SETUP_PENDING, DOMAIN_DISCONNECTED, SKILLS_UPDATE_AVAILABLE, CREDITS_LOW, GROUPS_ALERT, CHANNEL_ACCOUNT_LIVECHAT_DISABLED, EMAIL_INBOX_SYNC_FAILING, EMAIL_INBOX_SYNC_RECOVERED, WHATSAPP_NUMBER_UNAVAILABLE, WHATSAPP_NUMBER_RESTORED, CHANNEL_RECONNECT_REQUIRED, CHANNEL_DISCONNECTED, WHATSAPP_COEXISTENCE_DISCONNECTED, WHATSAPP_COEXISTENCE_INACTIVITY_WARNING, NEW_MESSAGE, CONVERSATION_ASSIGNED, SCHEDULED_MESSAGE_FAILED, MARKETPLACE_TESTIMONIAL_REQUESTED, MARKETPLACE_TESTIMONIAL_SUBMITTED, TASK_ASSIGNED. Canal que o tipo não usa responde `invalid_input`. Devolve a matriz inteira.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["ALL","PURCHASE_COMPLETED","PIX_EXPIRED","TRIAL_STARTED","PAYMENT_GENERATED","OPPORTUNITY_CREATED","OPPORTUNITY_WON","OPPORTUNITY_LOST","OPPORTUNITY_ASSIGNED","OPPORTUNITY_SLA_BREACHED","FLOWS_PAUSED_CHANNEL_DOWN","FLOWS_RESUMED","FLOW_RESUME_REQUIRED","FLOW_RUN_FAILED","FLOW_RUN_AT_RISK","DOMAIN_CONNECTED","DOMAIN_MIGRATION_NEEDED","DOMAIN_SETUP_PENDING","DOMAIN_DISCONNECTED","SKILLS_UPDATE_AVAILABLE","CREDITS_LOW","GROUPS_ALERT","CHANNEL_ACCOUNT_LIVECHAT_DISABLED","EMAIL_INBOX_SYNC_FAILING","EMAIL_INBOX_SYNC_RECOVERED","WHATSAPP_NUMBER_UNAVAILABLE","WHATSAPP_NUMBER_RESTORED","CHANNEL_RECONNECT_REQUIRED","CHANNEL_DISCONNECTED","WHATSAPP_COEXISTENCE_DISCONNECTED","WHATSAPP_COEXISTENCE_INACTIVITY_WARNING","NEW_MESSAGE","CONVERSATION_ASSIGNED","SCHEDULED_MESSAGE_FAILED","MARKETPLACE_TESTIMONIAL_REQUESTED","MARKETPLACE_TESTIMONIAL_SUBMITTED","TASK_ASSIGNED"]},"channel":{"type":"string","enum":["inApp","mobilePush"]},"enabled":{"type":"boolean"}},"required":["kind","channel","enabled"]},"example":{"kind":"PURCHASE_COMPLETED","channel":"mobilePush","enabled":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"general":{"type":"object","properties":{"inApp":{"type":"boolean"},"mobilePush":{"type":"boolean"}},"required":["inApp","mobilePush"],"additionalProperties":false},"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"kinds":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"inApp":{"type":["boolean","null"]},"mobilePush":{"type":["boolean","null"]}},"required":["kind","label","description","inApp","mobilePush"],"additionalProperties":false}}},"required":["key","title","kinds"],"additionalProperties":false}}},"required":["general","categories"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.list":{"post":{"operationId":"channel_connections.list","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.list.md"},"x-mcp-tool":"channel_connections_list","x-cli":"node cli/atomiks.mjs channel_connections.list --json '{...}'","x-session-only":false,"summary":"Listar as contas conectadas de WhatsApp ou Instagram","description":"As \"instâncias de canal\" do original (`GET /channel-instances`), só do canal pedido (`whatsapp`: números da API oficial e por QR code; `instagram`) e só as que o membro pode usar. Cada item traz `status` (`live`, `connecting` = QR ainda sem leitura, `error` = precisa reconectar), `syncing` (coexistência importando o histórico), número e conta da WABA, qualidade (`GREEN`/`YELLOW`/`RED`), limite de envio (`messagingLimitTier`), status do número, verificação do negócio e nome em revisão (da Meta, ao vivo e com cache de 5 minutos), nome, usuário, foto, seguidores e mídias do Instagram, `usagePermissions` (Chat ao Vivo, automações e disparo) e as flags do Atomiks (`humanAgent`, `receiveGroups`, `alwaysOnline`). Dado que a Meta não devolver vem `null`. Desconectados não aparecem.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","instagram"]}},"required":["channel"]},"example":{"channel":"whatsapp"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","whatsapp_unofficial","instagram"]},"status":{"type":"string","enum":["connecting","live","error"]},"syncing":{"type":"boolean"},"stableKey":{"type":"string"},"displayName":{"type":["string","null"]},"phone":{"type":["string","null"]},"wabaId":{"type":["string","null"]},"numberStatus":{"type":["string","null"]},"businessVerified":{"type":["boolean","null"]},"qualityRating":{"type":["string","null"]},"messagingLimitTier":{"type":["string","null"]},"requestedNameStatus":{"type":["string","null"]},"instagramName":{"type":["string","null"]},"instagramUsername":{"type":["string","null"]},"instagramBio":{"type":["string","null"]},"instagramWebsite":{"type":["string","null"]},"instagramFollowersCount":{"type":["number","null"]},"instagramFollowsCount":{"type":["number","null"]},"instagramMediaCount":{"type":["number","null"]},"instagramAccountType":{"type":["string","null"]},"profilePhotoUrl":{"type":["string","null"]},"usagePermissions":{"type":"object","properties":{"liveChat":{"type":"boolean"},"automations":{"type":"boolean"},"broadcast":{"type":"boolean"}},"required":["liveChat","automations","broadcast"],"additionalProperties":false},"connectionType":{"type":"string"},"humanAgent":{"type":"boolean"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"providerUpdateAvailable":{"type":"boolean"},"lastWebhookAt":{"type":["string","null"]},"syncedAt":{"type":["string","null"]},"archivedAt":{"type":"null"},"createdAt":{"type":"string"}},"required":["id","channel","status","syncing","stableKey","displayName","phone","wabaId","numberStatus","businessVerified","qualityRating","messagingLimitTier","requestedNameStatus","instagramName","instagramUsername","instagramBio","instagramWebsite","instagramFollowersCount","instagramFollowsCount","instagramMediaCount","instagramAccountType","profilePhotoUrl","usagePermissions","connectionType","humanAgent","receiveGroups","alwaysOnline","providerUpdateAvailable","lastWebhookAt","syncedAt","archivedAt","createdAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.get":{"post":{"operationId":"channel_connections.get","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.get.md"},"x-mcp-tool":"channel_connections_get","x-cli":"node cli/atomiks.mjs channel_connections.get --json '{...}'","x-session-only":false,"summary":"Ver uma conta conectada de WhatsApp ou Instagram","description":"O mesmo item de `channel_connections.list` para uma conta só (`GET /channel-instances/{id}`). `not_found` se a conta não existe, foi desconectada ou o membro não pode usá-la.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","whatsapp_unofficial","instagram"]},"status":{"type":"string","enum":["connecting","live","error"]},"syncing":{"type":"boolean"},"stableKey":{"type":"string"},"displayName":{"type":["string","null"]},"phone":{"type":["string","null"]},"wabaId":{"type":["string","null"]},"numberStatus":{"type":["string","null"]},"businessVerified":{"type":["boolean","null"]},"qualityRating":{"type":["string","null"]},"messagingLimitTier":{"type":["string","null"]},"requestedNameStatus":{"type":["string","null"]},"instagramName":{"type":["string","null"]},"instagramUsername":{"type":["string","null"]},"instagramBio":{"type":["string","null"]},"instagramWebsite":{"type":["string","null"]},"instagramFollowersCount":{"type":["number","null"]},"instagramFollowsCount":{"type":["number","null"]},"instagramMediaCount":{"type":["number","null"]},"instagramAccountType":{"type":["string","null"]},"profilePhotoUrl":{"type":["string","null"]},"usagePermissions":{"type":"object","properties":{"liveChat":{"type":"boolean"},"automations":{"type":"boolean"},"broadcast":{"type":"boolean"}},"required":["liveChat","automations","broadcast"],"additionalProperties":false},"connectionType":{"type":"string"},"humanAgent":{"type":"boolean"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"providerUpdateAvailable":{"type":"boolean"},"lastWebhookAt":{"type":["string","null"]},"syncedAt":{"type":["string","null"]},"archivedAt":{"type":"null"},"createdAt":{"type":"string"}},"required":["id","channel","status","syncing","stableKey","displayName","phone","wabaId","numberStatus","businessVerified","qualityRating","messagingLimitTier","requestedNameStatus","instagramName","instagramUsername","instagramBio","instagramWebsite","instagramFollowersCount","instagramFollowsCount","instagramMediaCount","instagramAccountType","profilePhotoUrl","usagePermissions","connectionType","humanAgent","receiveGroups","alwaysOnline","providerUpdateAvailable","lastWebhookAt","syncedAt","archivedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.refresh":{"post":{"operationId":"channel_connections.refresh","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.refresh.md"},"x-mcp-tool":"channel_connections_refresh","x-cli":"node cli/atomiks.mjs channel_connections.refresh --json '{...}'","x-session-only":false,"summary":"Atualizar os dados de uma conta conectada","description":"Busca de novo na Meta (ou no Instagram) a qualidade, o limite de envio, o status e a verificação do número, ou o nome, a foto e as contagens da conta do Instagram, ignorando o cache (`POST /channel-instances/{id}/resync`). Devolve o item atualizado.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","whatsapp_unofficial","instagram"]},"status":{"type":"string","enum":["connecting","live","error"]},"syncing":{"type":"boolean"},"stableKey":{"type":"string"},"displayName":{"type":["string","null"]},"phone":{"type":["string","null"]},"wabaId":{"type":["string","null"]},"numberStatus":{"type":["string","null"]},"businessVerified":{"type":["boolean","null"]},"qualityRating":{"type":["string","null"]},"messagingLimitTier":{"type":["string","null"]},"requestedNameStatus":{"type":["string","null"]},"instagramName":{"type":["string","null"]},"instagramUsername":{"type":["string","null"]},"instagramBio":{"type":["string","null"]},"instagramWebsite":{"type":["string","null"]},"instagramFollowersCount":{"type":["number","null"]},"instagramFollowsCount":{"type":["number","null"]},"instagramMediaCount":{"type":["number","null"]},"instagramAccountType":{"type":["string","null"]},"profilePhotoUrl":{"type":["string","null"]},"usagePermissions":{"type":"object","properties":{"liveChat":{"type":"boolean"},"automations":{"type":"boolean"},"broadcast":{"type":"boolean"}},"required":["liveChat","automations","broadcast"],"additionalProperties":false},"connectionType":{"type":"string"},"humanAgent":{"type":"boolean"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"providerUpdateAvailable":{"type":"boolean"},"lastWebhookAt":{"type":["string","null"]},"syncedAt":{"type":["string","null"]},"archivedAt":{"type":"null"},"createdAt":{"type":"string"}},"required":["id","channel","status","syncing","stableKey","displayName","phone","wabaId","numberStatus","businessVerified","qualityRating","messagingLimitTier","requestedNameStatus","instagramName","instagramUsername","instagramBio","instagramWebsite","instagramFollowersCount","instagramFollowsCount","instagramMediaCount","instagramAccountType","profilePhotoUrl","usagePermissions","connectionType","humanAgent","receiveGroups","alwaysOnline","providerUpdateAvailable","lastWebhookAt","syncedAt","archivedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.members":{"post":{"operationId":"channel_connections.members","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.members.md"},"x-mcp-tool":"channel_connections_members","x-cli":"node cli/atomiks.mjs channel_connections.members --json '{...}'","x-session-only":false,"summary":"Quem pode usar cada conta de WhatsApp ou Instagram","description":"Para cada conta do canal pedido, as pessoas da conta e se podem usá-la: administradores sempre (`alwaysAllowed`, `seatRole` `admin`) e membros só se a conta estiver liberada para eles em Configurações > Equipe (`hasAccess`). Traz nome e foto do perfil. `managementAccess` é sempre `false` (o Atomiks não separa gestão de uso). Só administrador (o `channels:manage` do original).","x-scope":"channels:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channel":{"type":"string","enum":["whatsapp","instagram"]}},"required":["channel"]},"example":{"channel":"whatsapp"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"channelInstanceId":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"personId":{"type":"string"},"name":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"seatRole":{"type":"string","enum":["admin","member"]},"alwaysAllowed":{"type":"boolean"},"hasAccess":{"type":"boolean"},"managementAccess":{"type":"boolean"}},"required":["personId","name","avatarUrl","seatRole","alwaysAllowed","hasAccess","managementAccess"],"additionalProperties":false}}},"required":["channelInstanceId","members"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.members_update":{"post":{"operationId":"channel_connections.members_update","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.members_update.md"},"x-mcp-tool":"channel_connections_members_update","x-cli":"node cli/atomiks.mjs channel_connections.members_update --json '{...}'","x-session-only":false,"summary":"Escolher quem pode usar uma conta de WhatsApp ou Instagram","description":"Define quais membros (não administradores) veem esta conta: `memberIds` é a lista completa dos que ficam com acesso. Administradores têm acesso sempre. Quem estava com acesso a todas as contas (`*`) passa a ter a lista explícita das contas da conta atual, menos esta se foi desmarcado.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"memberIds":{"type":"array","items":{"type":"string"}}},"required":["channelId","memberIds"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","memberIds":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"}},"required":["channelId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.profile_get":{"post":{"operationId":"channel_connections.profile_get","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.profile_get.md"},"x-mcp-tool":"channel_connections_profile_get","x-cli":"node cli/atomiks.mjs channel_connections.profile_get --json '{...}'","x-session-only":false,"summary":"Ver o perfil comercial de um número de WhatsApp","description":"O perfil que os clientes veem no WhatsApp (`whatsapp_business_profile` da Graph): sobre, descrição, endereço, e-mail, categoria, sites e foto, mais o nome de exibição e se um novo nome está em revisão. Só número da API oficial. `coexistence` diz que o número usa o app WhatsApp Business: a foto é do app e o nome passa por revisão manual.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"about":{"type":["string","null"]},"description":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"vertical":{"type":["string","null"]},"websites":{"type":"array","items":{"type":"string"}},"profilePictureUrl":{"type":["string","null"]},"displayName":{"type":["string","null"]},"nameUnderReview":{"type":"boolean"},"coexistence":{"type":"boolean"}},"required":["about","description","address","email","vertical","websites","profilePictureUrl","displayName","nameUnderReview","coexistence"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.profile_update":{"post":{"operationId":"channel_connections.profile_update","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.profile_update.md"},"x-mcp-tool":"channel_connections_profile_update","x-cli":"node cli/atomiks.mjs channel_connections.profile_update --json '{...}'","x-session-only":false,"summary":"Editar o perfil comercial de um número de WhatsApp","description":"Grava na Meta (`POST /{phone_number_id}/whatsapp_business_profile`) só os campos enviados: `about` (até 139), `description` (até 512), `address` (até 256), `email`, `vertical` (categoria) e `websites` (até 2, com https). Texto vazio apaga o campo. Devolve o perfil atualizado.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"about":{"type":"string","maxLength":139},"description":{"type":"string","maxLength":512},"address":{"type":"string","maxLength":256},"email":{"anyOf":[{"type":"string","const":""},{"type":"string","maxLength":128,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}]},"vertical":{"anyOf":[{"type":"string","const":""},{"type":"string","enum":["AUTO","BEAUTY","APPAREL","EDU","ENTERTAIN","EVENT_PLAN","FINANCE","GROCERY","GOVT","HOTEL","HEALTH","NONPROFIT","PROF_SERVICES","RETAIL","TRAVEL","RESTAURANT","OTHER"]}]},"websites":{"maxItems":2,"type":"array","items":{"type":"string","maxLength":256}}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","description":"Loja de roupas"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"about":{"type":["string","null"]},"description":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"vertical":{"type":["string","null"]},"websites":{"type":"array","items":{"type":"string"}},"profilePictureUrl":{"type":["string","null"]},"displayName":{"type":["string","null"]},"nameUnderReview":{"type":"boolean"},"coexistence":{"type":"boolean"}},"required":["about","description","address","email","vertical","websites","profilePictureUrl","displayName","nameUnderReview","coexistence"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.display_name_update":{"post":{"operationId":"channel_connections.display_name_update","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.display_name_update.md"},"x-mcp-tool":"channel_connections_display_name_update","x-cli":"node cli/atomiks.mjs channel_connections.display_name_update --json '{...}'","x-session-only":false,"summary":"Pedir a troca do nome de exibição de um número de WhatsApp","description":"Envia o novo nome à Meta (`new_display_name`). O nome passa por revisão e só vale depois da aprovação; até lá o nome atual continua. Devolve `pendingReview`. Número em coexistência: a Meta revisa à mão.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":3,"maxLength":512}},"required":["channelId","name"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","name":"Minha Loja"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pendingReview":{"type":"boolean","const":true}},"required":["pendingReview"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.profile_photo":{"post":{"operationId":"channel_connections.profile_photo","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.profile_photo.md"},"x-mcp-tool":"channel_connections_profile_photo","x-cli":"node cli/atomiks.mjs channel_connections.profile_photo --json '{...}'","x-session-only":false,"summary":"Trocar a foto do perfil de um número de WhatsApp","description":"Recebe a imagem (JPEG ou PNG, até 5 MB, em base64), envia à Meta pelo envio retomável (`/{app_id}/uploads`) e liga o resultado ao perfil (`profile_picture_handle`). Não vale para número em coexistência (a foto é do app WhatsApp Business). Exige `META_APP_ID` no servidor.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"mimeType":{"type":"string","enum":["image/jpeg","image/png"]},"dataBase64":{"type":"string","minLength":1,"maxLength":7340032}},"required":["channelId","mimeType","dataBase64"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","mimeType":"image/png","dataBase64":"iVBORw0KGgo="}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"about":{"type":["string","null"]},"description":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"vertical":{"type":["string","null"]},"websites":{"type":"array","items":{"type":"string"}},"profilePictureUrl":{"type":["string","null"]},"displayName":{"type":["string","null"]},"nameUnderReview":{"type":"boolean"},"coexistence":{"type":"boolean"}},"required":["about","description","address","email","vertical","websites","profilePictureUrl","displayName","nameUnderReview","coexistence"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.templates_list":{"post":{"operationId":"channel_connections.templates_list","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.templates_list.md"},"x-mcp-tool":"channel_connections_templates_list","x-cli":"node cli/atomiks.mjs channel_connections.templates_list --json '{...}'","x-session-only":false,"summary":"Listar os templates de um número de WhatsApp","description":"Os modelos da Meta do número, com categoria, status (`APPROVED`, `PENDING`, `REJECTED`, `PAUSED`), motivo da recusa, cabeçalho, corpo, rodapé e botões. Sincroniza antes se a última sincronização tem mais de 1 hora ou com `sync: true`.","x-scope":"channels:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sync":{"default":false,"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","sync":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"syncedAt":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"category":{"type":["string","null"]},"status":{"type":"string"},"rejectedReason":{"type":["string","null"]},"header":{"type":["string","null"]},"body":{"type":"string"},"footer":{"type":["string","null"]},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"text":{"type":"string"},"url":{"type":["string","null"]}},"required":["type","text","url"],"additionalProperties":false}}},"required":["id","name","language","category","status","rejectedReason","header","body","footer","buttons"],"additionalProperties":false}}},"required":["syncedAt","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.template_create":{"post":{"operationId":"channel_connections.template_create","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.template_create.md"},"x-mcp-tool":"channel_connections_template_create","x-cli":"node cli/atomiks.mjs channel_connections.template_create --json '{...}'","x-session-only":false,"summary":"Criar um template de WhatsApp e enviar para análise","description":"Cria o modelo na Meta (`POST /{waba}/message_templates`) e ele entra em análise. `name` com minúsculas, números e sublinhado; `category` `MARKETING` ou `UTILITY`; `language` (`pt_BR`, `pt_PT`, `en`, `es`...). `body` até 1024 caracteres, sem variável no começo nem no fim, e com `bodyExamples` (um exemplo por variável `{{1}}`, `{{2}}`...). Cabeçalho de texto (até 60, uma variável com `headerExample`), rodapé (até 60) e botões: até 3 de resposta ou 2 de link (variável só no fim da URL, com `example`). Cabeçalho de mídia, localização e autenticação ainda não.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$"},"category":{"type":"string","enum":["MARKETING","UTILITY"]},"language":{"type":"string","pattern":"^[a-z]{2}(_[A-Z]{2})?$"},"headerText":{"type":"string","maxLength":60},"headerExample":{"type":"string","maxLength":60},"body":{"type":"string","minLength":1,"maxLength":1024},"bodyExamples":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}},"footer":{"type":"string","maxLength":60},"buttons":{"default":[],"maxItems":3,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"QUICK_REPLY"},"text":{"type":"string","minLength":1,"maxLength":25}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","const":"URL"},"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","maxLength":2000},"example":{"type":"string","maxLength":2000}},"required":["type","text","url"]}]}}},"required":["channelId","name","category","language","body"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","name":"boas_vindas","category":"UTILITY","language":"pt_BR","body":"Olá {{1}}, seu pedido foi recebido.","bodyExamples":["Ana"],"buttons":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"}},"required":["id","status","category"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.template_delete":{"post":{"operationId":"channel_connections.template_delete","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.template_delete.md"},"x-mcp-tool":"channel_connections_template_delete","x-cli":"node cli/atomiks.mjs channel_connections.template_delete --json '{...}'","x-session-only":false,"summary":"Excluir um template de WhatsApp","description":"Apaga o modelo na Meta (`DELETE /{waba}/message_templates?name=`), em todos os idiomas daquele nome, e atualiza a lista. Não dá para desfazer.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$"}},"required":["channelId","name"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","name":"boas_vindas"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.test_status":{"post":{"operationId":"channel_connections.test_status","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.test_status.md"},"x-mcp-tool":"channel_connections_test_status","x-cli":"node cli/atomiks.mjs channel_connections.test_status --json '{...}'","x-session-only":false,"summary":"Ver se o número já recebeu uma mensagem para o teste","description":"A conversa mais recente deste número com a janela de 24 h aberta (quem escreveu por último), para o passo \"Teste a conexão\": `received` diz se já chegou mensagem, com `conversationId` para responder por `inbox.send`, o telefone e quando a janela fecha. Só número da API oficial.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"received":{"type":"boolean"},"conversationId":{"type":["string","null"]},"phone":{"type":["string","null"]},"windowExpiresAt":{"type":["string","null"]}},"required":["received","conversationId","phone","windowExpiresAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.whatsapp_web_history":{"post":{"operationId":"channel_connections.whatsapp_web_history","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.whatsapp_web_history.md"},"x-mcp-tool":"channel_connections_whatsapp_web_history","x-cli":"node cli/atomiks.mjs channel_connections.whatsapp_web_history --json '{...}'","x-session-only":false,"summary":"Ligar ou desligar o histórico no pareamento de um número por QR code","description":"Liga a importação de histórico na sessão do número: ao ler o QR code o WhatsApp entrega as conversas antigas e o Atomiks as importa (conversas individuais, até 50 mensagens por conversa, como histórico: sem não lida nem notificação). Só vale antes de o número parear; o WhatsApp decide quanto entrega, sem filtro por período. Desligado é o padrão.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"importHistory":{"type":"boolean"}},"required":["channelId","importHistory"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","importHistory":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"importHistory":{"type":"boolean"}},"required":["channelId","importHistory"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.diagnostics":{"post":{"operationId":"channel_connections.diagnostics","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.diagnostics.md"},"x-mcp-tool":"channel_connections_diagnostics","x-cli":"node cli/atomiks.mjs channel_connections.diagnostics --json '{...}'","x-session-only":false,"summary":"Eventos e falhas recentes de uma conta conectada","description":"O rastro da conexão (`channel_events`): os últimos 20 eventos do ciclo da conta (criada, credenciais obtidas, webhooks registrados, ativada, dados atualizados, permissões, desconexão, erro...), cada um com `outcome` (`success`, `failure`, `partial`, `in_progress`) e `traceId` (o `request_id` que liga ao Registro de auditoria). `failures` reúne, entre os últimos 100 eventos, os de falha, mais as falhas ao processar webhooks (`webhook_events`). Só administrador.","x-scope":"channels:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"outcome":{"type":"string"},"createdAt":{"type":"string"},"traceId":{"type":["string","null"]}},"required":["id","event","outcome","createdAt","traceId"],"additionalProperties":false}},"failures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"createdAt":{"type":"string"},"error":{"type":"string"},"traceId":{"type":["string","null"]}},"required":["id","event","createdAt","error","traceId"],"additionalProperties":false}}},"required":["events","failures"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/channel_connections.usage_update":{"post":{"operationId":"channel_connections.usage_update","tags":["channel_connections"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/channel_connections.usage_update.md"},"x-mcp-tool":"channel_connections_usage_update","x-cli":"node cli/atomiks.mjs channel_connections.usage_update --json '{...}'","x-session-only":false,"summary":"Ligar ou desligar o que uma conta de WhatsApp ou Instagram pode fazer","description":"Edita as \"Permissões de uso\" da conta: `liveChat` (responder pelo Atendimento), `automations` (fluxos e automações enviarem por ela) e `broadcast` (envio em massa; só o número da API oficial). Mande um ou mais campos. Desligado, o envio daquele tipo é recusado com `forbidden`; as conversas e os dados ficam. Devolve a conta atualizada.","x-scope":"channels:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"liveChat":{"type":"boolean"},"automations":{"type":"boolean"},"broadcast":{"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","automations":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","whatsapp_unofficial","instagram"]},"status":{"type":"string","enum":["connecting","live","error"]},"syncing":{"type":"boolean"},"stableKey":{"type":"string"},"displayName":{"type":["string","null"]},"phone":{"type":["string","null"]},"wabaId":{"type":["string","null"]},"numberStatus":{"type":["string","null"]},"businessVerified":{"type":["boolean","null"]},"qualityRating":{"type":["string","null"]},"messagingLimitTier":{"type":["string","null"]},"requestedNameStatus":{"type":["string","null"]},"instagramName":{"type":["string","null"]},"instagramUsername":{"type":["string","null"]},"instagramBio":{"type":["string","null"]},"instagramWebsite":{"type":["string","null"]},"instagramFollowersCount":{"type":["number","null"]},"instagramFollowsCount":{"type":["number","null"]},"instagramMediaCount":{"type":["number","null"]},"instagramAccountType":{"type":["string","null"]},"profilePhotoUrl":{"type":["string","null"]},"usagePermissions":{"type":"object","properties":{"liveChat":{"type":"boolean"},"automations":{"type":"boolean"},"broadcast":{"type":"boolean"}},"required":["liveChat","automations","broadcast"],"additionalProperties":false},"connectionType":{"type":"string"},"humanAgent":{"type":"boolean"},"receiveGroups":{"type":"boolean"},"alwaysOnline":{"type":"boolean"},"providerUpdateAvailable":{"type":"boolean"},"lastWebhookAt":{"type":["string","null"]},"syncedAt":{"type":["string","null"]},"archivedAt":{"type":"null"},"createdAt":{"type":"string"}},"required":["id","channel","status","syncing","stableKey","displayName","phone","wabaId","numberStatus","businessVerified","qualityRating","messagingLimitTier","requestedNameStatus","instagramName","instagramUsername","instagramBio","instagramWebsite","instagramFollowersCount","instagramFollowsCount","instagramMediaCount","instagramAccountType","profilePhotoUrl","usagePermissions","connectionType","humanAgent","receiveGroups","alwaysOnline","providerUpdateAvailable","lastWebhookAt","syncedAt","archivedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.list":{"post":{"operationId":"custom_fields.list","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.list.md"},"x-mcp-tool":"custom_fields_list","x-cli":"node cli/atomiks.mjs custom_fields.list --json '{...}'","x-session-only":false,"summary":"Listar campos customizados de Contatos ou Oportunidades","description":"Todos os campos do escopo (`entityType`: `leads` = Contatos, `opportunities` = Oportunidades), ativos e inativos, em ordem. Cada um traz a chave (`fieldName`), o rótulo (`displayName`), o tipo, as opções, a descrição, `required`, `filterable`, `pinned`, `isActive`, o grupo (`groupName`, nulo = sem grupo), `unique`, o preenchimento (`fillRate` de 0 a 1, `filledCount` de `totalRecords`) e os consumidores reais (`usageCount`, `usageByKind`: segmentos, automações e agendas que citam o campo). Também devolve `totalFields` (ativos), `inactiveFields`, `healthDistribution`, `typeCounts` e `groups` (quantidade de campos ativos e preenchimento médio por grupo).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]}},"required":["entityType"]},"example":{"entityType":"leads"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}},"totalFields":{"type":"number"},"inactiveFields":{"type":"number"},"healthDistribution":{"type":"object","properties":{"healthy":{"type":"number"},"attention":{"type":"number"},"critical":{"type":"number"},"unused":{"type":"number"}},"required":["healthy","attention","critical","unused"],"additionalProperties":false},"typeCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"count":{"type":"number"},"avgFillRate":{"type":"number"}},"required":["name","count","avgFillRate"],"additionalProperties":false}}},"required":["items","totalFields","inactiveFields","healthDistribution","typeCounts","groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.counts":{"post":{"operationId":"custom_fields.counts","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.counts.md"},"x-mcp-tool":"custom_fields_counts","x-cli":"node cli/atomiks.mjs custom_fields.counts --json '{...}'","x-session-only":false,"summary":"Quantidade de campos customizados por escopo","description":"Campos ativos de Contatos (`leads`) e de Oportunidades (`opportunities`): os números ao lado de \"Aplicado em\".","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"leads":{"type":"number"},"opportunities":{"type":"number"}},"required":["leads","opportunities"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.create":{"post":{"operationId":"custom_fields.create","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.create.md"},"x-mcp-tool":"custom_fields_create","x-cli":"node cli/atomiks.mjs custom_fields.create --json '{...}'","x-session-only":false,"summary":"Criar campo customizado de Contatos ou Oportunidades","description":"Cria o campo no escopo `entityType`. `fieldName` (a-z, 0-9, _) sai do nome de exibição se omitido (repetido informado dá `invalid_input`; o gerado ganha `_2`, `_3`). `groupName` põe o campo num grupo. Os tipos `select`, `multi_select` e `radio` exigem `options` (lista de textos ou `{label, value}`); os demais não aceitam. O tipo e a chave não mudam depois. Vai para o fim da lista.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"displayName":{"type":"string","minLength":1,"maxLength":80},"fieldName":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label"]}]}}},"required":["entityType","displayName","fieldType"]},"example":{"entityType":"leads","displayName":"Cidade","fieldType":"text"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.update":{"post":{"operationId":"custom_fields.update","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.update.md"},"x-mcp-tool":"custom_fields_update","x-cli":"node cli/atomiks.mjs custom_fields.update --json '{...}'","x-session-only":false,"summary":"Editar campo customizado de Contatos ou Oportunidades","description":"Muda o nome de exibição, a descrição, as opções (só campos de seleção; valores já gravados que saírem das opções continuam guardados), `required`, `filterable`, `pinned`, `unique`, `groupName` (nulo ou vazio tira do grupo) e `isActive`. `isActive: false` é o \"Excluir campo\" da tela: o campo sai de formulários, filtros e relatórios, os valores continuam guardados e voltam ao reativar (`true`). A chave e o tipo não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"displayName":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"options":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label"]}]}},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"unique":{"type":"boolean"},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"isActive":{"type":"boolean"}},"required":["entityType","id"]},"example":{"entityType":"leads","id":"00000000-0000-0000-0000-000000000000","displayName":"Cidade natal"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"objectId":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"required":{"type":"boolean"},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"isActive":{"type":"boolean"},"position":{"type":"number"},"usageCount":{"type":"number"},"usageByKind":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fillRate":{"type":"number"},"filledCount":{"type":"number"},"totalRecords":{"type":"number"},"isTitle":{"type":"boolean"},"groupName":{"type":["string","null"]},"unique":{"type":"boolean"},"lastEditedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","objectId","fieldName","displayName","fieldType","options","description","required","filterable","pinned","isActive","position","usageCount","usageByKind","fillRate","filledCount","totalRecords","isTitle","groupName","unique","lastEditedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.bulk_update":{"post":{"operationId":"custom_fields.bulk_update","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.bulk_update.md"},"x-mcp-tool":"custom_fields_bulk_update","x-cli":"node cli/atomiks.mjs custom_fields.bulk_update --json '{...}'","x-session-only":false,"summary":"Alterar vários campos customizados","description":"Aplica o mesmo `patch` a vários campos (`ids`, até 200, do escopo `entityType`): `groupName` (nulo tira do grupo), `filterable`, `pinned`, `required` e `isActive`. Devolve `updated`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"patch":{"type":"object","properties":{"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"filterable":{"type":"boolean"},"pinned":{"type":"boolean"},"required":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"required":["entityType","ids","patch"]},"example":{"entityType":"leads","ids":["00000000-0000-0000-0000-000000000000"],"patch":{"pinned":true}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.reorder":{"post":{"operationId":"custom_fields.reorder","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.reorder.md"},"x-mcp-tool":"custom_fields_reorder","x-cli":"node cli/atomiks.mjs custom_fields.reorder --json '{...}'","x-session-only":false,"summary":"Reordenar os campos customizados","description":"Define a posição e o grupo dos campos citados em `items` (`{id, order, groupName}`, o que o arrastar da tela envia). Campo de fora fica como estava. Devolve `updated`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"order":{"type":"integer","minimum":0,"maximum":1000},"groupName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["id","order"]}}},"required":["entityType","items"]},"example":{"entityType":"leads","items":[{"id":"00000000-0000-0000-0000-000000000000","order":0,"groupName":null}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.groups":{"post":{"operationId":"custom_fields.groups","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.groups.md"},"x-mcp-tool":"custom_fields_groups","x-cli":"node cli/atomiks.mjs custom_fields.groups --json '{...}'","x-session-only":false,"summary":"Grupos de campos customizados","description":"Nomes dos grupos já usados pelos campos do escopo (para o seletor \"Grupo\"), em ordem alfabética.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]}},"required":["entityType"]},"example":{"entityType":"leads"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.insights":{"post":{"operationId":"custom_fields.insights","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.insights.md"},"x-mcp-tool":"custom_fields_insights","x-cli":"node cli/atomiks.mjs custom_fields.insights --json '{...}'","x-session-only":false,"summary":"Uso de um campo customizado","description":"As abas Uso e Onde é usado: `fillRate`, `fillCount` de `totalEntities` (contatos ou oportunidades da conta), `emptyCount`, `filledLast30Days`, `trend` (curva acumulada dos últimos 6 meses: `month` AAAA-MM, `filled`, `fillRate`), `numeric` (mínimo, média, máximo e soma, só campos numéricos), `distinctValues`, `topValues` (`label`, `count`, `share`) e `references` (segmentos, automações e agendas que citam o campo; é o que pararia ao inativar). `lastEditedAt` é o último preenchimento.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entityType","id"]},"example":{"entityType":"leads","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fillRate":{"type":"number"},"fillCount":{"type":"number"},"totalEntities":{"type":"number"},"emptyCount":{"type":"number"},"filledLast30Days":{"type":"number"},"trend":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"filled":{"type":"number"},"fillRate":{"type":"number"}},"required":["month","filled","fillRate"],"additionalProperties":false}},"numeric":{"anyOf":[{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"},"sum":{"type":"number"},"avg":{"type":"number"}},"required":["min","max","sum","avg"],"additionalProperties":false},{"type":"null"}]},"distinctValues":{"type":"number"},"topValues":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"},"share":{"type":"number"}},"required":["label","count","share"],"additionalProperties":false}},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["segment","flow","schedule"]},"id":{"type":"string"},"name":{"type":"string"},"meta":{"type":["string","null"]},"parentId":{"type":["string","null"]}},"required":["kind","id","name","meta","parentId"],"additionalProperties":false}},"lastEditedAt":{"type":["string","null"]}},"required":["fillRate","fillCount","totalEntities","emptyCount","filledLast30Days","trend","numeric","distinctValues","topValues","references","lastEditedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.records":{"post":{"operationId":"custom_fields.records","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.records.md"},"x-mcp-tool":"custom_fields_records","x-cli":"node cli/atomiks.mjs custom_fields.records --json '{...}'","x-session-only":false,"summary":"Quem preencheu um campo customizado","description":"A aba Quem preencheu: os registros (contatos ou oportunidades) que têm valor no campo, do preenchimento mais recente para o mais antigo (`limit` até 100, padrão 50). Cada um traz `entityId`, `name`, `value` em texto, `filledAt` e `source` (manual, import, form, booking, webchat, flow, api, system, unknown; valor sem origem registrada vem como `unknown`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","enum":["leads","opportunities"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["entityType","id"]},"example":{"entityType":"leads","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"entityId":{"type":"string"},"entityType":{"type":"string","enum":["leads","opportunities"]},"name":{"type":["string","null"]},"value":{"type":"string"},"filledAt":{"type":"string"},"source":{"type":"string","enum":["manual","import","form","booking","webchat","flow","api","system","unknown"]}},"required":["entityId","entityType","name","value","filledAt","source"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.values_get":{"post":{"operationId":"custom_fields.values_get","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.values_get.md"},"x-mcp-tool":"custom_fields_values_get","x-cli":"node cli/atomiks.mjs custom_fields.values_get --json '{...}'","x-session-only":false,"summary":"Valores dos campos customizados de uma oportunidade","description":"Os campos ativos de Oportunidades (`custom_fields.list` com `entityType: opportunities`), cada um com o `value` gravado na oportunidade `id` (nulo quando vazio), na ordem da tela: é o que a gaveta da oportunidade mostra. O valor segue o tipo: texto, número, `AAAA-MM-DD`, opção, lista de opções (`multi_select`), sim/não, link, 1 a 5 (`rating`) ou id de arquivo.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entity":{"type":"string","const":"opportunity"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["entity","id"]},"example":{"entity":"opportunity","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"groupName":{"type":["string","null"]},"required":{"type":"boolean"},"pinned":{"type":"boolean"},"position":{"type":"number"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["id","fieldName","displayName","fieldType","options","description","groupName","required","pinned","position","value"],"additionalProperties":false}}},"required":["customFields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/custom_fields.values_set":{"post":{"operationId":"custom_fields.values_set","tags":["custom_fields"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/custom_fields.values_set.md"},"x-mcp-tool":"custom_fields_values_set","x-cli":"node cli/atomiks.mjs custom_fields.values_set --json '{...}'","x-session-only":false,"summary":"Gravar valores de campos customizados de uma oportunidade","description":"Lista de `{fieldId, value}` (até 50); `value: null` limpa, exceto em campo obrigatório. Cada valor é validado pelo tipo do campo (texto, número, data `AAAA-MM-DD`, opção, lista de opções, link, 1 a 5, sim/não, id de arquivo). Tudo ou nada: um valor inválido recusa o pedido. Devolve os campos ativos com os valores, como `custom_fields.values_get`. `unique` ainda não é verificado na gravação.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entity":{"type":"string","const":"opportunity"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"values":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["fieldId","value"]}},"source":{"type":"string","enum":["manual","import","form","booking","webchat","flow","api"]}},"required":["entity","id","values"]},"example":{"entity":"opportunity","id":"00000000-0000-0000-0000-000000000000","values":[{"fieldId":"00000000-0000-0000-0000-000000000000","value":"Mentoria"}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fieldName":{"type":"string"},"displayName":{"type":"string"},"fieldType":{"type":"string","enum":["text","textarea","number","currency","percentage","date","select","multi_select","radio","link","rating","boolean","file","image"]},"options":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false}},{"type":"null"}]},"description":{"type":["string","null"]},"groupName":{"type":["string","null"]},"required":{"type":"boolean"},"pinned":{"type":"boolean"},"position":{"type":"number"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["id","fieldName","displayName","fieldType","options","description","groupName","required","pinned","position","value"],"additionalProperties":false}}},"required":["customFields"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.overview":{"post":{"operationId":"pipelines.overview","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.overview.md"},"x-mcp-tool":"pipelines_overview","x-cli":"node cli/atomiks.mjs pipelines.overview --json '{...}'","x-session-only":false,"summary":"Números por pipeline (lista de todos os pipelines)","description":"Pipelines não arquivados da conta com o que a lista de pipelines mostra: contatos, valor total, oportunidades abertas, ganhas e perdidas (quantidade e valor, em centavos), última atividade (a atualização mais recente de uma oportunidade), atendentes e tipos vinculados, e o funil por etapa (quantidade e valor).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"createdAt":{"type":"string"},"lastActivityAt":{"type":["string","null"]},"totalContacts":{"type":"number"},"totalValueCents":{"type":"number"},"openCount":{"type":"number"},"openValueCents":{"type":"number"},"wonCount":{"type":"number"},"wonValueCents":{"type":"number"},"lostCount":{"type":"number"},"lostValueCents":{"type":"number"},"attendantIds":{"type":"array","items":{"type":"string"}},"attendantTypeIds":{"type":"array","items":{"type":"string"}},"stages":{"type":"array","items":{"type":"object","properties":{"stageId":{"type":"string"},"stageName":{"type":"string"},"displayOrder":{"type":"number"},"type":{"type":"string","enum":["open","won","lost"]},"cardCount":{"type":"number"},"totalValueCents":{"type":"number"}},"required":["stageId","stageName","displayOrder","type","cardCount","totalValueCents"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","createdAt","lastActivityAt","totalContacts","totalValueCents","openCount","openValueCents","wonCount","wonValueCents","lostCount","lostValueCents","attendantIds","attendantTypeIds","stages"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.settings_get":{"post":{"operationId":"pipelines.settings_get","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.settings_get.md"},"x-mcp-tool":"pipelines_settings_get","x-cli":"node cli/atomiks.mjs pipelines.settings_get --json '{...}'","x-session-only":false,"summary":"Ver as configurações de um pipeline","description":"Nome, grupo, se é o padrão e se está arquivado, mais o que a tela \"Configurações do Pipeline\" guarda: descrição, distribuição automática (`autoAssign`, `autoAssignStrategy` manual ou rodízio), SLA de inatividade e de primeiro contato, propriedade e agendamento, motivos de perda (`lostReasons`, `restrictLossReasons`), prioridade e moeda padrão, exibição do card (`cardDisplay`) e o pixel do pipeline. Sem a migration de configurações, devolve os padrões.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"archivedAt":{"type":["string","null"]},"description":{"type":["string","null"]},"autoAssign":{"type":"boolean"},"autoAssignStrategy":{"type":"string","enum":["manual","round_robin"]},"teamId":{"type":["string","null"]},"teamDistributionMode":{"anyOf":[{"type":"string","enum":["weighted","strict"]},{"type":"null"}]},"slaEnabled":{"type":"boolean"},"slaInactivityDays":{"type":"number"},"slaTargetStageId":{"type":["string","null"]},"slaFirstContactEnabled":{"type":"boolean"},"slaFirstContactMinutes":{"type":"number"},"assignResponsibleOnScheduling":{"type":"boolean"},"restrictSchedulingToPeers":{"type":"boolean"},"lostReasons":{"type":"array","items":{"type":"string"}},"restrictLossReasons":{"type":"boolean"},"defaultPriority":{"type":"string","enum":["urgent","high","medium","low","none"]},"defaultCurrency":{"type":"string","enum":["BRL","USD","EUR"]},"cardDisplay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"pixelEnabled":{"type":"boolean"},"pixelEvent":{"type":["string","null"]},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}},"required":["pipelineId","name","groupName","isDefault","archivedAt","description","autoAssign","autoAssignStrategy","teamId","teamDistributionMode","slaEnabled","slaInactivityDays","slaTargetStageId","slaFirstContactEnabled","slaFirstContactMinutes","assignResponsibleOnScheduling","restrictSchedulingToPeers","lostReasons","restrictLossReasons","defaultPriority","defaultCurrency","cardDisplay","pixelEnabled","pixelEvent","cardOrder"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.settings_update":{"post":{"operationId":"pipelines.settings_update","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.settings_update.md"},"x-mcp-tool":"pipelines_settings_update","x-cli":"node cli/atomiks.mjs pipelines.settings_update --json '{...}'","x-session-only":false,"summary":"Alterar as configurações de um pipeline","description":"Altera só o que for enviado (campos de `pipelines.settings_get`; nome e grupo ficam em `crm.pipeline_update`). `description` vazio limpa; `slaTargetStageId` precisa ser etapa do pipeline; `lostReasons` troca a lista inteira; `cardDisplay` troca o objeto inteiro (chaves `show…` e `hideWhenEmpty`). Exige a migration de configurações (`migration_pendente` sem ela).","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"autoAssign":{"type":"boolean"},"autoAssignStrategy":{"type":"string","enum":["manual","round_robin"]},"slaEnabled":{"type":"boolean"},"slaInactivityDays":{"type":"integer","minimum":1,"maximum":365},"slaTargetStageId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"slaFirstContactEnabled":{"type":"boolean"},"slaFirstContactMinutes":{"type":"integer","minimum":1,"maximum":1440},"assignResponsibleOnScheduling":{"type":"boolean"},"restrictSchedulingToPeers":{"type":"boolean"},"lostReasons":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"restrictLossReasons":{"type":"boolean"},"defaultPriority":{"type":"string","enum":["urgent","high","medium","low","none"]},"defaultCurrency":{"type":"string","enum":["BRL","USD","EUR"]},"cardDisplay":{"type":"object","properties":{"showCompanyName":{"type":"boolean"},"showAssignedAttendant":{"type":"boolean"},"showContactCard":{"type":"boolean"},"showProductName":{"type":"boolean"},"showTotalValue":{"type":"boolean"},"showFunnelName":{"type":"boolean"},"showDate":{"type":"boolean"},"showPaymentStatus":{"type":"boolean"},"showScheduledMeeting":{"type":"boolean"},"showNextAction":{"type":"boolean"},"showLeadIndicators":{"type":"boolean"},"showCustomObjects":{"type":"boolean"},"showSubscription":{"type":"boolean"},"hideWhenEmpty":{"type":"boolean"}},"additionalProperties":false},"pixelEnabled":{"type":"boolean"},"pixelEvent":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","autoAssign":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"archivedAt":{"type":["string","null"]},"description":{"type":["string","null"]},"autoAssign":{"type":"boolean"},"autoAssignStrategy":{"type":"string","enum":["manual","round_robin"]},"teamId":{"type":["string","null"]},"teamDistributionMode":{"anyOf":[{"type":"string","enum":["weighted","strict"]},{"type":"null"}]},"slaEnabled":{"type":"boolean"},"slaInactivityDays":{"type":"number"},"slaTargetStageId":{"type":["string","null"]},"slaFirstContactEnabled":{"type":"boolean"},"slaFirstContactMinutes":{"type":"number"},"assignResponsibleOnScheduling":{"type":"boolean"},"restrictSchedulingToPeers":{"type":"boolean"},"lostReasons":{"type":"array","items":{"type":"string"}},"restrictLossReasons":{"type":"boolean"},"defaultPriority":{"type":"string","enum":["urgent","high","medium","low","none"]},"defaultCurrency":{"type":"string","enum":["BRL","USD","EUR"]},"cardDisplay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"pixelEnabled":{"type":"boolean"},"pixelEvent":{"type":["string","null"]},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}},"required":["pipelineId","name","groupName","isDefault","archivedAt","description","autoAssign","autoAssignStrategy","teamId","teamDistributionMode","slaEnabled","slaInactivityDays","slaTargetStageId","slaFirstContactEnabled","slaFirstContactMinutes","assignResponsibleOnScheduling","restrictSchedulingToPeers","lostReasons","restrictLossReasons","defaultPriority","defaultCurrency","cardDisplay","pixelEnabled","pixelEvent","cardOrder"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.archive_set":{"post":{"operationId":"pipelines.archive_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.archive_set.md"},"x-mcp-tool":"pipelines_archive_set","x-cli":"node cli/atomiks.mjs pipelines.archive_set --json '{...}'","x-session-only":false,"summary":"Arquivar ou restaurar um pipeline","description":"`archived: true` esconde o pipeline das listas (o padrão não pode: marque outro antes); `archived: false` o restaura. Os cards permanecem salvos. Devolve as configurações do pipeline.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"}},"required":["pipelineId","archived"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","archived":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"archivedAt":{"type":["string","null"]},"description":{"type":["string","null"]},"autoAssign":{"type":"boolean"},"autoAssignStrategy":{"type":"string","enum":["manual","round_robin"]},"teamId":{"type":["string","null"]},"teamDistributionMode":{"anyOf":[{"type":"string","enum":["weighted","strict"]},{"type":"null"}]},"slaEnabled":{"type":"boolean"},"slaInactivityDays":{"type":"number"},"slaTargetStageId":{"type":["string","null"]},"slaFirstContactEnabled":{"type":"boolean"},"slaFirstContactMinutes":{"type":"number"},"assignResponsibleOnScheduling":{"type":"boolean"},"restrictSchedulingToPeers":{"type":"boolean"},"lostReasons":{"type":"array","items":{"type":"string"}},"restrictLossReasons":{"type":"boolean"},"defaultPriority":{"type":"string","enum":["urgent","high","medium","low","none"]},"defaultCurrency":{"type":"string","enum":["BRL","USD","EUR"]},"cardDisplay":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"pixelEnabled":{"type":"boolean"},"pixelEvent":{"type":["string","null"]},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}},"required":["pipelineId","name","groupName","isDefault","archivedAt","description","autoAssign","autoAssignStrategy","teamId","teamDistributionMode","slaEnabled","slaInactivityDays","slaTargetStageId","slaFirstContactEnabled","slaFirstContactMinutes","assignResponsibleOnScheduling","restrictSchedulingToPeers","lostReasons","restrictLossReasons","defaultPriority","defaultCurrency","cardDisplay","pixelEnabled","pixelEvent","cardOrder"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stages_reorder":{"post":{"operationId":"pipelines.stages_reorder","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stages_reorder.md"},"x-mcp-tool":"pipelines_stages_reorder","x-cli":"node cli/atomiks.mjs pipelines.stages_reorder --json '{...}'","x-session-only":false,"summary":"Reordenar as etapas abertas de um pipeline","description":"Define a ordem das etapas abertas (`stageIds`, todas as abertas do pipeline, sem repetir); Ganho e Perdido ficam sempre no fim.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["pipelineId","stageIds"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","stageIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string"},"stageIds":{"type":"array","items":{"type":"string"}}},"required":["pipelineId","stageIds"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_rules_list":{"post":{"operationId":"pipelines.stage_rules_list","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_rules_list.md"},"x-mcp-tool":"pipelines_stage_rules_list","x-cli":"node cli/atomiks.mjs pipelines.stage_rules_list --json '{...}'","x-session-only":false,"summary":"Regras das etapas de um pipeline","description":"Regras de cada etapa do pipeline (campos obrigatórios, limite de cards, direção) com o número atual de cards (`currentCount`). Etapa sem regra volta com os padrões (tudo desligado).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"stageId":{"type":"string"},"requiredOn":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["standard","custom"]},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false}},"wipOn":{"type":"boolean"},"wipLimit":{"type":"number"},"wipMode":{"type":"string","enum":["warn","block"]},"directionOn":{"type":"boolean"},"direction":{"type":"string","enum":["any","forward","one_step","terminal"]},"currentCount":{"type":"number"}},"required":["stageId","requiredOn","requiredFields","wipOn","wipLimit","wipMode","directionOn","direction","currentCount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_rules_get":{"post":{"operationId":"pipelines.stage_rules_get","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_rules_get.md"},"x-mcp-tool":"pipelines_stage_rules_get","x-cli":"node cli/atomiks.mjs pipelines.stage_rules_get --json '{...}'","x-session-only":false,"summary":"Regras de uma etapa","description":"Campos obrigatórios para entrar (`requiredOn`, `requiredFields` com `kind` standard ou custom), limite de cards (`wipOn`, `wipLimit`, `wipMode` warn ou block), direção permitida (`directionOn`, `direction`: any, forward, one_step, terminal) e `currentCount`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["stageId"]},"example":{"stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string"},"requiredOn":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["standard","custom"]},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false}},"wipOn":{"type":"boolean"},"wipLimit":{"type":"number"},"wipMode":{"type":"string","enum":["warn","block"]},"directionOn":{"type":"boolean"},"direction":{"type":"string","enum":["any","forward","one_step","terminal"]},"currentCount":{"type":"number"}},"required":["stageId","requiredOn","requiredFields","wipOn","wipLimit","wipMode","directionOn","direction","currentCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_rules_set":{"post":{"operationId":"pipelines.stage_rules_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_rules_set.md"},"x-mcp-tool":"pipelines_stage_rules_set","x-cli":"node cli/atomiks.mjs pipelines.stage_rules_set --json '{...}'","x-session-only":false,"summary":"Definir as regras de uma etapa","description":"Troca as regras da etapa aberta (campos de `pipelines.stage_rules_get`; o que não for enviado fica como está). Os campos obrigatórios padrão (`kind: standard`) são: value, expectedClosingDate, priority, probability, origin, title, productIds, primaryCompany, primaryAttendant; `kind: custom` leva o id de um campo de `custom_fields.list` com `entityType: opportunities` (campo arquivado ou apagado deixa de exigir). Exige a migration de configurações.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requiredOn":{"type":"boolean"},"requiredFields":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["standard","custom"]},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"]}},"wipOn":{"type":"boolean"},"wipLimit":{"type":"integer","minimum":1,"maximum":100000},"wipMode":{"type":"string","enum":["warn","block"]},"directionOn":{"type":"boolean"},"direction":{"type":"string","enum":["any","forward","one_step","terminal"]}},"required":["stageId"]},"example":{"stageId":"00000000-0000-0000-0000-000000000000","wipOn":true,"wipLimit":20,"wipMode":"warn"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string"},"requiredOn":{"type":"boolean"},"requiredFields":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["standard","custom"]},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false}},"wipOn":{"type":"boolean"},"wipLimit":{"type":"number"},"wipMode":{"type":"string","enum":["warn","block"]},"directionOn":{"type":"boolean"},"direction":{"type":"string","enum":["any","forward","one_step","terminal"]},"currentCount":{"type":"number"}},"required":["stageId","requiredOn","requiredFields","wipOn","wipLimit","wipMode","directionOn","direction","currentCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_move_check":{"post":{"operationId":"pipelines.stage_move_check","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_move_check.md"},"x-mcp-tool":"pipelines_stage_move_check","x-cli":"node cli/atomiks.mjs pipelines.stage_move_check --json '{...}'","x-session-only":false,"summary":"Conferir se um card pode ir para uma etapa","description":"Avalia as regras antes de mover: campos obrigatórios e limite de cards da etapa de destino, direção da etapa de origem. `allowed` é falso quando alguma violação bloqueia (`blocking`); aviso de limite (`mode: warn`) não bloqueia e pede confirmação na tela. Não move nada.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toStageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["opportunityId","toStageId"]},"example":{"opportunityId":"00000000-0000-0000-0000-000000000000","toStageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"allowed":{"type":"boolean"},"violations":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["required","wip","direction"]},"blocking":{"type":"boolean"},"message":{"type":"string"},"missingFields":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["standard","custom"]},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false}},"limit":{"type":"number"},"current":{"type":"number"},"mode":{"type":"string","enum":["warn","block"]},"direction":{"type":"string","enum":["any","forward","one_step","terminal"]}},"required":["type","blocking","message"],"additionalProperties":false}},"toStageName":{"type":"string"},"fromStageName":{"type":"string"}},"required":["allowed","violations","toStageName","fromStageName"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_get":{"post":{"operationId":"pipelines.opportunity_get","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_get.md"},"x-mcp-tool":"pipelines_opportunity_get","x-cli":"node cli/atomiks.mjs pipelines.opportunity_get --json '{...}'","x-session-only":false,"summary":"Detalhe da oportunidade (gaveta)","description":"Tudo que a gaveta da oportunidade mostra: o card (contatos, empresas e ofertas vinculados, responsável e atendentes por papel, tags, prioridade, previsão, probabilidade, origem, \"indicado por\", motivo e observação da perda), as etapas do pipeline, as passagens por etapa (tempo em cada uma), os motivos de perda já usados no pipeline e o total de arquivos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"valueCents":{"type":["number","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false}},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"priceCents":{"type":["number","null"]}},"required":["id","name","priceCents"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":["string","null"]},"typeId":{"type":["string","null"]},"typeName":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["attendantId","attendantName","typeId","typeName","isPrimary"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"referredBy":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"lossObservation":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","status","valueCents","pipelineId","pipelineName","stageId","stageName","contactId","contactName","contacts","companies","offers","owner","attendants","tags","priority","expectedCloseDate","probability","origin","referredBy","lostReason","lostAt","lossObservation","createdAt","updatedAt"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"fromStageId":{"type":["string","null"]},"toStageId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["fromStageId","toStageId","createdAt"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"string"}},"attachmentsCount":{"type":"number"}},"required":["card","stages","history","lostReasons","attachmentsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_extra_set":{"post":{"operationId":"pipelines.opportunity_extra_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_extra_set.md"},"x-mcp-tool":"pipelines_opportunity_extra_set","x-cli":"node cli/atomiks.mjs pipelines.opportunity_extra_set --json '{...}'","x-session-only":false,"summary":"Editar \"indicado por\" da oportunidade","description":"Define (ou limpa com `null`) o campo \"Indicado por\" do card. Os demais campos (título, valor, prioridade, previsão, probabilidade, origem) saem por `crm.opportunity_update`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"referredBy":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["id","referredBy"]},"example":{"id":"00000000-0000-0000-0000-000000000000","referredBy":"Ana"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"referredBy":{"type":["string","null"]}},"required":["id","referredBy"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_status_set":{"post":{"operationId":"pipelines.opportunity_status_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_status_set.md"},"x-mcp-tool":"pipelines_opportunity_status_set","x-cli":"node cli/atomiks.mjs pipelines.opportunity_status_set --json '{...}'","x-session-only":false,"summary":"Marcar a oportunidade como ganha, perdida ou reabrir","description":"`won` e `lost` levam o card para a etapa Ganho/Perdido do pipeline (`lost` aceita `lossReason` e `lossObservation`); `open` reabre na primeira etapa aberta. Dispara o evento da Meta e a cadência da etapa, como `crm.opportunity_move`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","won","lost"]},"lossReason":{"type":"string","maxLength":200},"lossObservation":{"type":"string","maxLength":1000}},"required":["id","status"]},"example":{"id":"00000000-0000-0000-0000-000000000000","status":"lost","lossReason":"Preço"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"valueCents":{"type":["number","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false}},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"priceCents":{"type":["number","null"]}},"required":["id","name","priceCents"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":["string","null"]},"typeId":{"type":["string","null"]},"typeName":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["attendantId","attendantName","typeId","typeName","isPrimary"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"referredBy":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"lossObservation":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","status","valueCents","pipelineId","pipelineName","stageId","stageName","contactId","contactName","contacts","companies","offers","owner","attendants","tags","priority","expectedCloseDate","probability","origin","referredBy","lostReason","lostAt","lossObservation","createdAt","updatedAt"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"fromStageId":{"type":["string","null"]},"toStageId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["fromStageId","toStageId","createdAt"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"string"}},"attachmentsCount":{"type":"number"}},"required":["card","stages","history","lostReasons","attachmentsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_links_set":{"post":{"operationId":"pipelines.opportunity_links_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_links_set.md"},"x-mcp-tool":"pipelines_opportunity_links_set","x-cli":"node cli/atomiks.mjs pipelines.opportunity_links_set --json '{...}'","x-session-only":false,"summary":"Vincular contatos, empresas e ofertas à oportunidade","description":"Troca as listas informadas (as omitidas ficam como estão). O primeiro de cada lista é o principal (`contactId`, `companyId` e `productId` do card; o contato principal não pode ficar vazio); os demais ficam nos vínculos extras. `applyOfferValue: true` troca o valor do card pela soma do preço das ofertas.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"offerIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"applyOfferValue":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","offerIds":["00000000-0000-0000-0000-000000000000"],"applyOfferValue":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"valueCents":{"type":["number","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false}},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"priceCents":{"type":["number","null"]}},"required":["id","name","priceCents"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":["string","null"]},"typeId":{"type":["string","null"]},"typeName":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["attendantId","attendantName","typeId","typeName","isPrimary"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"referredBy":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"lossObservation":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","status","valueCents","pipelineId","pipelineName","stageId","stageName","contactId","contactName","contacts","companies","offers","owner","attendants","tags","priority","expectedCloseDate","probability","origin","referredBy","lostReason","lostAt","lossObservation","createdAt","updatedAt"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"fromStageId":{"type":["string","null"]},"toStageId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["fromStageId","toStageId","createdAt"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"string"}},"attachmentsCount":{"type":"number"}},"required":["card","stages","history","lostReasons","attachmentsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_tags_set":{"post":{"operationId":"pipelines.opportunity_tags_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_tags_set.md"},"x-mcp-tool":"pipelines_opportunity_tags_set","x-cli":"node cli/atomiks.mjs pipelines.opportunity_tags_set --json '{...}'","x-session-only":false,"summary":"Definir as tags da oportunidade","description":"Troca as tags do card por `tagIds` (de `crm.tags_list`). As tags do contato não mudam.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","tagIds"]},"example":{"id":"00000000-0000-0000-0000-000000000000","tagIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}},"required":["id","tags"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_assignments_set":{"post":{"operationId":"pipelines.opportunity_assignments_set","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_assignments_set.md"},"x-mcp-tool":"pipelines_opportunity_assignments_set","x-cli":"node cli/atomiks.mjs pipelines.opportunity_assignments_set --json '{...}'","x-session-only":false,"summary":"Definir os atendentes da oportunidade por papel","description":"Troca os atendentes do card (um por papel, `attendantTypeId`; sem papel vale \"Sem categoria\"). O principal (`isPrimary`, ou o primeiro) vira o responsável (`ownerId`). Lista vazia tira todos os atendentes e o responsável. Diferente de `crm.opportunities_bulk_attendants`, aceita lista vazia.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assignments":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantTypeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"isPrimary":{"type":"boolean"}},"required":["attendantId"]}}},"required":["id","assignments"]},"example":{"id":"00000000-0000-0000-0000-000000000000","assignments":[{"attendantId":"00000000-0000-0000-0000-000000000000","attendantTypeId":"00000000-0000-0000-0000-000000000000","isPrimary":true}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"valueCents":{"type":["number","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false}},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"priceCents":{"type":["number","null"]}},"required":["id","name","priceCents"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":["string","null"]},"typeId":{"type":["string","null"]},"typeName":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["attendantId","attendantName","typeId","typeName","isPrimary"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"referredBy":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"lossObservation":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","status","valueCents","pipelineId","pipelineName","stageId","stageName","contactId","contactName","contacts","companies","offers","owner","attendants","tags","priority","expectedCloseDate","probability","origin","referredBy","lostReason","lostAt","lossObservation","createdAt","updatedAt"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"fromStageId":{"type":["string","null"]},"toStageId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["fromStageId","toStageId","createdAt"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"string"}},"attachmentsCount":{"type":"number"}},"required":["card","stages","history","lostReasons","attachmentsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_feed":{"post":{"operationId":"pipelines.opportunity_feed","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_feed.md"},"x-mcp-tool":"pipelines_opportunity_feed","x-cli":"node cli/atomiks.mjs pipelines.opportunity_feed --json '{...}'","x-session-only":false,"summary":"Linha do tempo da oportunidade","description":"Atividades do contato (as da oportunidade têm `opportunityId`) mais as anotações manuais do card, do mais recente para o mais antigo, no formato de `activities.list`. `q` procura no texto das anotações e nos dados de cada atividade. As anotações manuais entram todas na página 1.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"q":{"type":"string","maxLength":120},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{}},"meta":{"type":"object","properties":{"countItens":{"type":"number"},"countPages":{"type":"number"},"page":{"type":"number"},"perPage":{"type":"number"}},"required":["countItens","countPages","page","perPage"],"additionalProperties":false},"timezone":{"type":"string"}},"required":["data","meta","timezone"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_activity_create":{"post":{"operationId":"pipelines.opportunity_activity_create","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_activity_create.md"},"x-mcp-tool":"pipelines_opportunity_activity_create","x-cli":"node cli/atomiks.mjs pipelines.opportunity_activity_create --json '{...}'","x-session-only":false,"summary":"Registrar atividade manual na oportunidade","description":"Anotação, ligação, WhatsApp, reunião, tarefa ou e-mail registrados à mão no card (`type`: note, call, whatsapp, meeting, task, email). Aparece na linha do tempo como \"Atividade manual\".","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["note","call","whatsapp","meeting","task","email"]},"description":{"type":"string","minLength":1,"maxLength":5000}},"required":["id","type","description"]},"example":{"id":"00000000-0000-0000-0000-000000000000","type":"note","description":"Cliente pediu desconto."}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_activity_update":{"post":{"operationId":"pipelines.opportunity_activity_update","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_activity_update.md"},"x-mcp-tool":"pipelines_opportunity_activity_update","x-cli":"node cli/atomiks.mjs pipelines.opportunity_activity_update --json '{...}'","x-session-only":false,"summary":"Editar atividade manual da oportunidade","description":"Muda o texto de uma atividade manual (`description`) ou a fixa/desafixa (`pinned`).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1,"maxLength":5000},"pinned":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","description":"Texto novo"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_activity_delete":{"post":{"operationId":"pipelines.opportunity_activity_delete","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_activity_delete.md"},"x-mcp-tool":"pipelines_opportunity_activity_delete","x-cli":"node cli/atomiks.mjs pipelines.opportunity_activity_delete --json '{...}'","x-session-only":false,"summary":"Apagar atividade manual da oportunidade","description":"Apaga uma atividade manual. Não dá para desfazer.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_attachments_list":{"post":{"operationId":"pipelines.opportunity_attachments_list","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_attachments_list.md"},"x-mcp-tool":"pipelines_opportunity_attachments_list","x-cli":"node cli/atomiks.mjs pipelines.opportunity_attachments_list --json '{...}'","x-session-only":false,"summary":"Arquivos da oportunidade","description":"Arquivos anexados ao card (mais recentes primeiro), cada um com um link temporário (1 hora) em `url`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"url":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":"string","const":"opportunity"}},"required":["id","name","mimeType","size","url","createdAt","source"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_attachment_upload":{"post":{"operationId":"pipelines.opportunity_attachment_upload","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_attachment_upload.md"},"x-mcp-tool":"pipelines_opportunity_attachment_upload","x-cli":"node cli/atomiks.mjs pipelines.opportunity_attachment_upload --json '{...}'","x-session-only":false,"summary":"Anexar arquivo à oportunidade","description":"Guarda um arquivo (até 10 MB; PDF, imagem, TXT, CSV, ZIP ou documento do Office) no card. `content` é o arquivo em base64.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","minLength":1,"maxLength":14000000}},"required":["id","name","mimeType","content"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"proposta.pdf","mimeType":"application/pdf","content":"JVBERi0xLjQK"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"url":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":"string","const":"opportunity"}},"required":["id","name","mimeType","size","url","createdAt","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_attachment_delete":{"post":{"operationId":"pipelines.opportunity_attachment_delete","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_attachment_delete.md"},"x-mcp-tool":"pipelines_opportunity_attachment_delete","x-cli":"node cli/atomiks.mjs pipelines.opportunity_attachment_delete --json '{...}'","x-session-only":false,"summary":"Remover arquivo da oportunidade","description":"Remove o arquivo do card e do armazenamento.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attachmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","attachmentId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","attachmentId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.opportunity_transfer":{"post":{"operationId":"pipelines.opportunity_transfer","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.opportunity_transfer.md"},"x-mcp-tool":"pipelines_opportunity_transfer","x-cli":"node cli/atomiks.mjs pipelines.opportunity_transfer --json '{...}'","x-session-only":false,"summary":"Transferir a oportunidade para outro pipeline","description":"Leva o card para a etapa `stageId` (aberta) de outro pipeline, no fim da coluna.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","pipelineId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"valueCents":{"type":["number","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","phone","email"],"additionalProperties":false}},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"priceCents":{"type":["number","null"]}},"required":["id","name","priceCents"],"additionalProperties":false}},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"attendants":{"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string"},"attendantName":{"type":["string","null"]},"typeId":{"type":["string","null"]},"typeName":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["attendantId","attendantName","typeId","typeName","isPrimary"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"referredBy":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"lossObservation":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","status","valueCents","pipelineId","pipelineName","stageId","stageName","contactId","contactName","contacts","companies","offers","owner","attendants","tags","priority","expectedCloseDate","probability","origin","referredBy","lostReason","lostAt","lossObservation","createdAt","updatedAt"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"fromStageId":{"type":["string","null"]},"toStageId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["fromStageId","toStageId","createdAt"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"string"}},"attachmentsCount":{"type":"number"}},"required":["card","stages","history","lostReasons","attachmentsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.board":{"post":{"operationId":"pipelines.board","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.board.md"},"x-mcp-tool":"pipelines_board","x-cli":"node cli/atomiks.mjs pipelines.board --json '{...}'","x-session-only":false,"summary":"Quadro de oportunidades com filtros","description":"Como `crm.board` (pipeline, cards por etapa em ordem, totais por etapa e próxima ação), com a consulta do quadro: busca `q`, status (`open`, `won`, `lost`, `all`), atendentes, safra (`AAAA-MM` ou `AAAA-Www`, pela criação), filtros simples (prioridade, origem, tags, produtos, empresas, contatos, valor, previsão), ordem dos cards e o filtro avançado `filter`: grupos \"todas/qualquer\" ligados por E/OU, com os campos de Oportunidade, Datas, Pipeline, Relações, Tarefa e `lead` (filtro de contato). Os totais e as contagens já refletem o filtro.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]},"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","status":"open","priorities":["high"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"isDefault":{"type":"boolean"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"position":{"type":"number"},"capiEvent":{"type":["string","null"]}},"required":["id","name","kind","position","capiEvent"],"additionalProperties":false}}},"required":["id","name","groupName","isDefault","stages"],"additionalProperties":false},"cards":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}},"totals":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"count":{"type":"number"},"valueCents":{"type":"number"}},"required":["count","valueCents"],"additionalProperties":false}},"nextTasks":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"},"assignee":{"type":["string","null"]}},"required":["title","dueAt","kind","assignee"],"additionalProperties":false}}},"required":["pipeline","cards","totals"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.filter_count":{"post":{"operationId":"pipelines.filter_count","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.filter_count.md"},"x-mcp-tool":"pipelines_filter_count","x-cli":"node cli/atomiks.mjs pipelines.filter_count --json '{...}'","x-session-only":false,"summary":"Contar oportunidades de um filtro avançado","description":"Quantas oportunidades visíveis ao chamador, em todos os pipelines, casam com o filtro avançado (o número do rodapé do modal de filtro). Sem condições, conta todas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}}},"required":["filter"]},"example":{"filter":[{"matcher":"all","connector":"and","conditions":[{"field":"status","operator":"equals","value":"open"}]}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_cards":{"post":{"operationId":"pipelines.stage_cards","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_cards.md"},"x-mcp-tool":"pipelines_stage_cards","x-cli":"node cli/atomiks.mjs pipelines.stage_cards --json '{...}'","x-session-only":false,"summary":"Cards de uma etapa, com paginação (visão em lista)","description":"Oportunidades de uma etapa na ordem do quadro, filtradas pelo `query` (busca, status, atendente, coorte). `page` a partir de 1; `perPage` até 200 (padrão 50). `meta.countItens` é o total da etapa com o filtro, `valueCents` a soma, `countPages` as páginas. Cada card traz as tags do contato e a próxima tarefa aberta.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":200}},"required":["pipelineId","stageId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":["string","null"]},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"nextTask":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"},"assignee":{"type":["string","null"]}},"required":["id","title","dueAt","kind","assignee"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company","createdAt","wonAt","lostAt","tags","nextTask"],"additionalProperties":false}},"meta":{"type":"object","properties":{"countItens":{"type":"number"},"countPages":{"type":"number"},"valueCents":{"type":"number"}},"required":["countItens","countPages","valueCents"],"additionalProperties":false}},"required":["items","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.stage_summary":{"post":{"operationId":"pipelines.stage_summary","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.stage_summary.md"},"x-mcp-tool":"pipelines_stage_summary","x-cli":"node cli/atomiks.mjs pipelines.stage_summary --json '{...}'","x-session-only":false,"summary":"Total e valor por etapa com o filtro do quadro","description":"Para cada etapa do pipeline: quantas oportunidades batem com o `query` e a soma dos valores (centavos). Etapas sem card vêm com zero.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"stageId":{"type":"string"},"count":{"type":"number"},"valueCents":{"type":"number"}},"required":["stageId","count","valueCents"],"additionalProperties":false}}},"required":["stages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.forecast":{"post":{"operationId":"pipelines.forecast","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.forecast.md"},"x-mcp-tool":"pipelines_forecast","x-cli":"node cli/atomiks.mjs pipelines.forecast --json '{...}'","x-session-only":false,"summary":"Previsão de vendas por período","description":"Baldes por dia, semana (segunda a domingo) ou mês, pela data prevista de fechamento: cards abertos com probabilidade (valor e valor ponderado `valor × probabilidade`) e, com `includeWon`, os ganhos pelo valor cheio. Perdidos nunca entram. Respeita o `query` do quadro; o status dele é ignorado.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}},"granularity":{"type":"string","enum":["day","week","month"]},"includeWon":{"type":"boolean"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"buckets":{"type":"array","items":{"type":"object","properties":{"periodStart":{"type":"string"},"openCount":{"type":"number"},"openValue":{"type":"number"},"openWeightedValue":{"type":"number"},"wonCount":{"type":"number"},"wonValue":{"type":"number"},"forecastValue":{"type":"number"}},"required":["periodStart","openCount","openValue","openWeightedValue","wonCount","wonValue","forecastValue"],"additionalProperties":false}}},"required":["buckets"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.forecast_cards":{"post":{"operationId":"pipelines.forecast_cards","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.forecast_cards.md"},"x-mcp-tool":"pipelines_forecast_cards","x-cli":"node cli/atomiks.mjs pipelines.forecast_cards --json '{...}'","x-session-only":false,"summary":"Cards de um período da previsão","description":"Oportunidades elegíveis (abertas com probabilidade e, com `includeWon`, ganhas) cuja data prevista cai entre `periodStart` e `periodEnd` (AAAA-MM-DD), por data e depois maior probabilidade. Paginado como `pipelines.stage_cards`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"granularity":{"type":"string","enum":["day","week","month"]},"includeWon":{"type":"boolean"},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":200}},"required":["pipelineId","periodStart"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","periodStart":"2026-10-26"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":["string","null"]},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}},"nextTask":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"dueAt":{"type":["string","null"]},"kind":{"type":"string"},"assignee":{"type":["string","null"]}},"required":["id","title","dueAt","kind","assignee"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company","createdAt","wonAt","lostAt","tags","nextTask"],"additionalProperties":false}},"meta":{"type":"object","properties":{"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["countItens","countPages"],"additionalProperties":false}},"required":["items","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_move":{"post":{"operationId":"pipelines.bulk_move","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_move.md"},"x-mcp-tool":"pipelines_bulk_move","x-cli":"node cli/atomiks.mjs pipelines.bulk_move --json '{...}'","x-session-only":false,"summary":"Mover oportunidades de etapa em massa","description":"Move as oportunidades escolhidas para uma etapa do mesmo pipeline, no fim da coluna. Ganho e Perdido ajustam `status`, `won_at` e `lost_at`; o evento da Meta e as cadências da etapa disparam como no `crm.opportunity_move`. Quem já está na etapa não conta.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"targetStageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["targetStageId"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"targetStageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_transfer":{"post":{"operationId":"pipelines.bulk_transfer","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_transfer.md"},"x-mcp-tool":"pipelines_bulk_transfer","x-cli":"node cli/atomiks.mjs pipelines.bulk_transfer --json '{...}'","x-session-only":false,"summary":"Transferir oportunidades para outro pipeline","description":"Leva as oportunidades para uma etapa de outro pipeline (`targetPipelineId`/`targetStageId`). `keepResponsible` mantém o responsável e `keepRoles` os atendentes por papel, só de quem atende o pipeline de destino (se ele não tem atendentes cadastrados, todos servem). Serve também para uma só oportunidade (`cardIds: [id]`).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"targetPipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"targetStageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"keepResponsible":{"type":"boolean"},"keepRoles":{"type":"boolean"}},"required":["targetPipelineId","targetStageId"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"targetPipelineId":"00000000-0000-0000-0000-000000000000","targetStageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_attendants":{"post":{"operationId":"pipelines.bulk_attendants","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_attendants.md"},"x-mcp-tool":"pipelines_bulk_attendants","x-cli":"node cli/atomiks.mjs pipelines.bulk_attendants --json '{...}'","x-session-only":false,"summary":"Atribuir atendentes por papel em massa","description":"Troca os atendentes das oportunidades por `assignments` (um atendente por papel; o principal, ou o primeiro, vira o responsável). Igual ao `crm.opportunities_bulk_attendants`, mas aceita o filtro completo do quadro em `scope.query`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"assignments":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantTypeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"isPrimary":{"type":"boolean"}},"required":["attendantId"]}}},"required":["assignments"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"assignments":[{"attendantId":"00000000-0000-0000-0000-000000000000","attendantTypeId":"00000000-0000-0000-0000-000000000000","isPrimary":true}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_responsible":{"post":{"operationId":"pipelines.bulk_responsible","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_responsible.md"},"x-mcp-tool":"pipelines_bulk_responsible","x-cli":"node cli/atomiks.mjs pipelines.bulk_responsible --json '{...}'","x-session-only":false,"summary":"Definir o responsável das oportunidades em massa","description":"`assignment.mode`: `fixed` (um atendente), `multiple` (revezamento entre `attendantIds`) ou `round_robin` (membros do time `teamId`, na ordem da fila). Troca o `owner_id` das oportunidades escolhidas; o rodízio segue a ordem em que o servidor as lê.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"assignment":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"fixed"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","attendantId"]},{"type":"object","properties":{"mode":{"type":"string","const":"multiple"},"attendantIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["mode","attendantIds"]},{"type":"object","properties":{"mode":{"type":"string","const":"round_robin"},"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","teamId"]}]}},"required":["assignment"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"assignment":{"mode":"fixed","attendantId":"00000000-0000-0000-0000-000000000000"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_offers":{"post":{"operationId":"pipelines.bulk_offers","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_offers.md"},"x-mcp-tool":"pipelines_bulk_offers","x-cli":"node cli/atomiks.mjs pipelines.bulk_offers --json '{...}'","x-session-only":false,"summary":"Atribuir ofertas (produtos) em massa","description":"No Atomiks a oferta é o produto do catálogo (`crm.products_list`). Grava o primeiro de `offerIds` como produto da oportunidade (lista vazia limpa) e, com `applyOfferValue`, troca o valor pela soma dos preços dos escolhidos.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"offerIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"applyOfferValue":{"type":"boolean"}},"required":["offerIds"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"offerIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_value":{"post":{"operationId":"pipelines.bulk_value","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_value.md"},"x-mcp-tool":"pipelines_bulk_value","x-cli":"node cli/atomiks.mjs pipelines.bulk_value --json '{...}'","x-session-only":false,"summary":"Trocar o valor das oportunidades em massa","description":"`value` em centavos; `null` limpa o valor.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"value":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["value"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"value":150000}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_priority":{"post":{"operationId":"pipelines.bulk_priority","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_priority.md"},"x-mcp-tool":"pipelines_bulk_priority","x-cli":"node cli/atomiks.mjs pipelines.bulk_priority --json '{...}'","x-session-only":false,"summary":"Trocar a prioridade das oportunidades em massa","description":"`priority`: urgent, high, medium, low ou none (sem prioridade).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]}},"required":["priority"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"priority":"high"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_closing_date":{"post":{"operationId":"pipelines.bulk_closing_date","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_closing_date.md"},"x-mcp-tool":"pipelines_bulk_closing_date","x-cli":"node cli/atomiks.mjs pipelines.bulk_closing_date --json '{...}'","x-session-only":false,"summary":"Trocar a data de fechamento em massa","description":"`expectedClosingDate` no formato AAAA-MM-DD; `null` limpa a data.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"expectedClosingDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["expectedClosingDate"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"expectedClosingDate":"2026-12-31"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_delete":{"post":{"operationId":"pipelines.bulk_delete","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_delete.md"},"x-mcp-tool":"pipelines_bulk_delete","x-cli":"node cli/atomiks.mjs pipelines.bulk_delete --json '{...}'","x-session-only":false,"summary":"Excluir oportunidades em massa","description":"Apaga as oportunidades escolhidas. Vendas já registradas continuam, sem o vínculo.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]}}},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_tags":{"post":{"operationId":"pipelines.bulk_tags","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_tags.md"},"x-mcp-tool":"pipelines_bulk_tags","x-cli":"node cli/atomiks.mjs pipelines.bulk_tags --json '{...}'","x-session-only":false,"summary":"Aplicar tags aos contatos das oportunidades em massa","description":"Soma as tags `tagIds` aos contatos das oportunidades escolhidas; quem já tem a tag não é duplicado.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"tagIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["tagIds"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"tagIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_custom_field":{"post":{"operationId":"pipelines.bulk_custom_field","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_custom_field.md"},"x-mcp-tool":"pipelines_bulk_custom_field","x-cli":"node cli/atomiks.mjs pipelines.bulk_custom_field --json '{...}'","x-session-only":false,"summary":"Gravar um campo personalizado de oportunidade em massa","description":"`customFieldId` de `custom_fields.list` com `entityType: opportunities` (campo ativo). `value: null` apaga o valor (recusado em campo obrigatório). O valor segue o tipo do campo, como em `custom_fields.values_set`: texto, número, data AAAA-MM-DD, opção, lista de opções, sim/não, link, 1 a 5. Grava em `opportunity_field_values` (sem a migration dos campos de oportunidade responde `migration_pendente`).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"customFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"value":{"anyOf":[{},{"type":"null"}]}},"required":["customFieldId","value"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"customFieldId":"00000000-0000-0000-0000-000000000000","value":"Mentoria"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_next_action":{"post":{"operationId":"pipelines.bulk_next_action","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_next_action.md"},"x-mcp-tool":"pipelines_bulk_next_action","x-cli":"node cli/atomiks.mjs pipelines.bulk_next_action --json '{...}'","x-session-only":false,"summary":"Criar a próxima ação (tarefa) nas oportunidades em massa","description":"Cria uma tarefa por oportunidade, no contato dela (`type`: task, call, whatsapp ou meeting). `deadline` é um instante ISO; `attendantId` é quem faz.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"type":{"type":"string","enum":["task","call","whatsapp","meeting"]},"title":{"type":"string","minLength":1,"maxLength":200},"deadline":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":{"type":"string","maxLength":5000},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","title"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"type":"call","title":"Ligar para fechar"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","affected","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.bulk_create_list":{"post":{"operationId":"pipelines.bulk_create_list","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.bulk_create_list.md"},"x-mcp-tool":"pipelines_bulk_create_list","x-cli":"node cli/atomiks.mjs pipelines.bulk_create_list --json '{...}'","x-session-only":false,"summary":"Criar uma lista com os contatos das oportunidades","description":"Cria (ou reaproveita, se o nome já existe) uma lista de contatos e põe nela os contatos das oportunidades escolhidas, uma vez cada. `emoji` é aceito mas a lista do Atomiks não guarda emoji.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"name":{"type":"string","minLength":1,"maxLength":80},"emoji":{"type":"string","maxLength":16}},"required":["name"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"name":"Oportunidades quentes"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"affected":{"type":"number"},"skipped":{"type":"number"},"listId":{"type":"string"}},"required":["mode","jobId","affected","skipped","listId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.export_csv":{"post":{"operationId":"pipelines.export_csv","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.export_csv.md"},"x-mcp-tool":"pipelines_export_csv","x-cli":"node cli/atomiks.mjs pipelines.export_csv --json '{...}'","x-session-only":false,"summary":"Exportar oportunidades em CSV","description":"Devolve o texto do CSV (UTF-8 com BOM) das oportunidades escolhidas, com as `columns` na ordem pedida (chaves de `EXPORT_COLUMNS` ou `cf:<id do campo personalizado do contato>`). Até 5000 linhas por chamada, sempre síncrono. Valor em unidades com duas casas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cardIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"allMatching":{"type":"boolean","const":true},"scope":{"type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"query":{"type":"object","properties":{"q":{"type":"string","maxLength":120},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attendantIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"cohort":{"type":"string","maxLength":64},"status":{"type":"string","enum":["open","won","lost","all"]},"filter":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"value":{"anyOf":[{"anyOf":[{"type":"string","maxLength":4000},{"maxItems":500,"type":"array","items":{"type":"string","maxLength":200}},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]},"lead":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}}},"required":["field","operator"]}}},"required":["matcher","connector","conditions"]}},"priorities":{"maxItems":4,"type":"array","items":{"type":"string","enum":["low","normal","high","urgent"]}},"origins":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":120}},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"companyIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"contactIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"valueMinCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"valueMaxCents":{"type":"integer","minimum":0,"maximum":9007199254740991},"expectedClosingDateFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedClosingDateTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cardOrder":{"type":"string","enum":["manual","createdAtDesc","createdAtAsc","stageTimeAsc","stageTimeDesc"]}}}},"required":["pipelineId"]},"columns":{"minItems":1,"maxItems":80,"type":"array","items":{"type":"string","maxLength":80}}},"required":["columns"]},"example":{"cardIds":["00000000-0000-0000-0000-000000000000"],"columns":["title","stageName"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.import_sources":{"post":{"operationId":"pipelines.import_sources","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.import_sources.md"},"x-mcp-tool":"pipelines_import_sources","x-cli":"node cli/atomiks.mjs pipelines.import_sources --json '{...}'","x-session-only":false,"summary":"Listas ou segmentos de contatos para importar numa etapa","description":"Até 50 listas (`kind: \"lists\"`) ou segmentos (`kind: \"segments\"`) por busca no nome (`q`), cada um com `leadCount`. Com `ids`, devolve só esses e recalcula a contagem dos segmentos na hora (passo de confirmação).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["lists","segments"]},"q":{"type":"string","maxLength":80},"ids":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["kind"]},"example":{"kind":"lists"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"leadCount":{"type":"number"}},"required":["id","name","leadCount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.import_contacts":{"post":{"operationId":"pipelines.import_contacts","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.import_contacts.md"},"x-mcp-tool":"pipelines_import_contacts","x-cli":"node cli/atomiks.mjs pipelines.import_contacts --json '{...}'","x-session-only":false,"summary":"Importar contatos de listas e segmentos para uma etapa","description":"Cria uma oportunidade por contato das listas (`listIds`) e segmentos (`segmentIds`, recalculados na hora) na etapa aberta, no fim da coluna e com o nome do contato como título. Contato que já tem oportunidade no pipeline é pulado (`skipped`). `assignment`: `fixed`, `multiple` (revezamento) ou `round_robin` (time); sem ele o card fica sem responsável. Etapa com limite de cards em modo `block` recusa a importação que o passaria. Até 5000 contatos por chamada.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"listIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"segmentIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"assignment":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"fixed"},"attendantId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","attendantId"]},{"type":"object","properties":{"mode":{"type":"string","const":"multiple"},"attendantIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["mode","attendantIds"]},{"type":"object","properties":{"mode":{"type":"string","const":"round_robin"},"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mode","teamId"]}]}},"required":["pipelineId","stageId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000","listIds":["00000000-0000-0000-0000-000000000000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","const":"sync"},"jobId":{"type":"null"},"totalLeads":{"type":"number"},"created":{"type":"number"},"skipped":{"type":"number"}},"required":["mode","jobId","totalLeads","created","skipped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.people_stats":{"post":{"operationId":"pipelines.people_stats","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.people_stats.md"},"x-mcp-tool":"pipelines_people_stats","x-cli":"node cli/atomiks.mjs pipelines.people_stats --json '{...}'","x-session-only":false,"summary":"Atendentes de um pipeline com contagem de oportunidades","description":"Atendentes do pipeline (`isMember`) e, fora dele, os que têm oportunidades nele, cada um com `openCards`, `wonCards`, `lostCards` e `totalCards` neste pipeline, e os tipos de atendente. Com `includeAll`, devolve também os atendentes sem vínculo e sem oportunidades (para escolher quem entra no pipeline). Sem a migration de atendentes, ninguém é membro.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pipelineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"includeAll":{"type":"boolean"}},"required":["pipelineId"]},"example":{"pipelineId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":["string","null"]},"isMember":{"type":"boolean"},"openCards":{"type":"number"},"wonCards":{"type":"number"},"lostCards":{"type":"number"},"totalCards":{"type":"number"},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","name","avatarUrl","isMember","openCards","wonCards","lostCards","totalCards","types"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pipelines.card_move":{"post":{"operationId":"pipelines.card_move","tags":["pipelines"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pipelines.card_move.md"},"x-mcp-tool":"pipelines_card_move","x-cli":"node cli/atomiks.mjs pipelines.card_move --json '{...}'","x-session-only":false,"summary":"Mover oportunidade de etapa com as regras da etapa","description":"Igual a `crm.opportunity_move`, mas antes confere as regras da etapa de destino (`pipelines.stage_rules_*`): campo obrigatório faltando ou limite de cards (modo bloqueio) recusa o movimento.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"beforeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lostReason":{"type":"string","maxLength":200}},"required":["id","stageId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","stageId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"pipelineId":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost"]},"title":{"type":"string"},"valueCents":{"type":["number","null"]},"product":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["id","name","phone"],"additionalProperties":false},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"openTasks":{"type":"number"},"updatedAt":{"type":"string"},"priority":{"anyOf":[{"type":"string","enum":["low","normal","high","urgent"]},{"type":"null"}]},"expectedCloseDate":{"type":["string","null"]},"probability":{"type":["number","null"]},"origin":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"company":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","pipelineId","stageId","status","title","valueCents","product","contact","owner","openTasks","updatedAt","priority","expectedCloseDate","probability","origin","lostReason","company"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audit_hub.list":{"post":{"operationId":"audit_hub.list","tags":["audit_hub"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/audit_hub.list.md"},"x-mcp-tool":"audit_hub_list","x-cli":"node cli/atomiks.mjs audit_hub.list --json '{...}'","x-session-only":false,"summary":"Auditoria da conta","description":"Quem alterou o quê na conta, quando e por qual canal, do mais recente ao mais antigo (último ano). Filtros por período, área, ação, canal, papel, pessoa, item e busca. Use `before` (id do último item) para a página seguinte.","x-scope":"activity:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"resources":{"maxItems":60,"type":"array","items":{"type":"string","maxLength":64}},"actions":{"maxItems":12,"type":"array","items":{"type":"string","enum":["create","update","delete","manage","import","export","publish","unpublish","activate","pause","archive","duplicate"]}},"channels":{"maxItems":5,"type":"array","items":{"type":"string","enum":["user","ai","api","flow","system"]}},"roles":{"maxItems":4,"type":"array","items":{"type":"string","enum":["owner","admin","member","integrator"]}},"people":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"search":{"type":"string","maxLength":120},"entity":{"type":"string","maxLength":255},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":30,"type":"integer","minimum":1,"maximum":100}}},"example":{"limit":30}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"action":{"type":"string","enum":["create","update","delete","manage","import","export","publish","unpublish","activate","pause","archive","duplicate"]},"rawAction":{"type":"string"},"resource":{"type":"string"},"entityId":{"type":["string","null"]},"channel":{"type":"string","enum":["user","ai","api","flow","system"]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"imageUrl":{"type":["string","null"]}},"required":["id","name","email","imageUrl"],"additionalProperties":false},{"type":"null"}]},"actorRole":{"anyOf":[{"type":"string","enum":["owner","admin","member","integrator"]},{"type":"null"}]},"ip":{"type":["string","null"]},"input":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"method":{"type":"string"},"route":{"type":"string"},"statusCode":{"type":"number"}},"required":["id","createdAt","action","rawAction","resource","entityId","channel","actor","actorRole","ip","input","method","route","statusCode"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]},"total":{"type":["number","null"]}},"required":["items","nextBefore","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.hub_active":{"post":{"operationId":"integrations.hub_active","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.hub_active.md"},"x-mcp-tool":"integrations_hub_active","x-cli":"node cli/atomiks.mjs integrations.hub_active --json '{...}'","x-session-only":false,"summary":"Integrações ativas (selo do catálogo)","description":"Conectores com ao menos uma integração ativa e os eventos assinados pelas integrações de saída ativas. O catálogo `/integracoes/explorar` usa para marcar o cartão como ativo.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connectors":{"type":"array","items":{"type":"string"}},"events":{"type":"array","items":{"type":"string"}}},"required":["connectors","events"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.records":{"post":{"operationId":"integrations.records","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.records.md"},"x-mcp-tool":"integrations_records","x-cli":"node cli/atomiks.mjs integrations.records --json '{...}'","x-session-only":false,"summary":"Requisições de uma integração (página)","description":"Histórico da integração como no original: entrada lista os eventos recebidos, saída as entregas. Paginado por página (`page`, `perPage`), com filtro de status (COMPLETED, PROCESSING, FAILED, DELAYED) e ordem por data. Devolve também a contagem por status (sem o filtro) para os cartões do topo.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["COMPLETED","PROCESSING","FAILED","DELAYED"]},"order":{"default":"DESC","type":"string","enum":["ASC","DESC"]},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"default":10,"type":"integer","minimum":1,"maximum":100}},"required":["integrationId"]},"example":{"integrationId":"00000000-0000-0000-0000-000000000000","order":"DESC","page":1,"perPage":10}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"type":{"type":"string","enum":["in","out"]},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"type":["string","null"]},"status":{"type":"string","enum":["COMPLETED","PROCESSING","FAILED","DELAYED"]},"createdAt":{"type":"string"},"attempts":{"type":["number","null"]}},"required":["id","trigger","status","createdAt","attempts"],"additionalProperties":false}},"total":{"type":"number"},"countPages":{"type":"number"},"counts":{"type":"object","properties":{"all":{"type":"number"},"completed":{"type":"number"},"processing":{"type":"number"},"failed":{"type":"number"},"delayed":{"type":"number"}},"required":["all","completed","processing","failed","delayed"],"additionalProperties":false}},"required":["type","records","total","countPages","counts"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.record":{"post":{"operationId":"integrations.record","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.record.md"},"x-mcp-tool":"integrations_record","x-cli":"node cli/atomiks.mjs integrations.record --json '{...}'","x-session-only":false,"summary":"Detalhe de uma requisição","description":"Corpo, cabeçalhos e tentativas de uma requisição de `integrations.records`. Entrada: o corpo normalizado que o Atomiks guardou (traz dados pessoais do comprador); os cabeçalhos recebidos não são guardados. Saída: o corpo e os cabeçalhos enviados (sem a assinatura), a resposta e o erro da última tentativa.","x-scope":"automations:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["integrationId","id"]},"example":{"integrationId":"00000000-0000-0000-0000-000000000000","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["in","out"]},"status":{"type":"string","enum":["COMPLETED","PROCESSING","FAILED","DELAYED"]},"createdAt":{"type":"string"},"trigger":{"type":["string","null"]},"attempts":{"type":"number"},"responseStatus":{"type":["number","null"]},"error":{"type":["string","null"]},"body":{},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","type","status","createdAt","trigger","attempts","responseStatus","error","body","headers"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.retry_delivery":{"post":{"operationId":"integrations.retry_delivery","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.retry_delivery.md"},"x-mcp-tool":"integrations_retry_delivery","x-cli":"node cli/atomiks.mjs integrations.retry_delivery --json '{...}'","x-session-only":false,"summary":"Reenviar uma entrega de saída","description":"Volta a entrega para a fila (`pending`, tentativas zeradas) e o envio roda no próximo ciclo. Só integrações de saída; entrega em andamento não pode ser reenviada.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"integrationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["integrationId","id"]},"example":{"integrationId":"00000000-0000-0000-0000-000000000000","id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/integrations.test_url":{"post":{"operationId":"integrations.test_url","tags":["integrations"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/integrations.test_url.md"},"x-mcp-tool":"integrations_test_url","x-cli":"node cli/atomiks.mjs integrations.test_url --json '{...}'","x-session-only":false,"summary":"Enviar teste para uma URL (antes de criar)","description":"Envia agora o evento `test.ping.v1` para a URL (https) da tela de criação de uma integração de saída, sem criar nada. O envio vai assinado com um segredo descartável; depois de criar, use `integrations.test`.","x-scope":"automations:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"example":{"url":"https://hooks.example.com/atomiks"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"number"},"error":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.segments_overview":{"post":{"operationId":"segmentation.segments_overview","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.segments_overview.md"},"x-mcp-tool":"segmentation_segments_overview","x-cli":"node cli/atomiks.mjs segmentation.segments_overview --json '{...}'","x-session-only":false,"summary":"Segmentos com a contagem de contatos","description":"Lista de \"Segmentos\" (Contatos & Comercial > Segmentação > Filtros): cada segmento salvo com o total de contatos que o filtro casa agora (`leadCount`, só os contatos que quem pede vê). Do mais recentemente editado ao mais antigo; `q` filtra pelo nome. Paginação de 10 por padrão.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":10}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"leadCount":{"type":"number"},"refreshedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","emoji","filter","leadCount","refreshedAt","createdAt"],"additionalProperties":false}},"total":{"type":"number"},"countPages":{"type":"number"}},"required":["items","total","countPages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.segment_get":{"post":{"operationId":"segmentation.segment_get","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.segment_get.md"},"x-mcp-tool":"segmentation_segment_get","x-cli":"node cli/atomiks.mjs segmentation.segment_get --json '{...}'","x-session-only":false,"summary":"Ver um segmento com a contagem de contatos","description":"Um segmento salvo (nome, emoji, `filter`) e o total de contatos que ele casa agora.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"leadCount":{"type":"number"},"refreshedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","emoji","filter","leadCount","refreshedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.segment_duplicate":{"post":{"operationId":"segmentation.segment_duplicate","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.segment_duplicate.md"},"x-mcp-tool":"segmentation_segment_duplicate","x-cli":"node cli/atomiks.mjs segmentation.segment_duplicate --json '{...}'","x-session-only":false,"summary":"Duplicar segmento","description":"Cria uma cópia do segmento (mesmo filtro e emoji) chamada \"<nome> (cópia)\"; se o nome já existe, \"<nome> (cópia 2)\" e assim por diante.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"filter":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"order":{"type":"integer","minimum":0,"maximum":1000},"field":{"type":"string","maxLength":60},"operator":{"type":"string","maxLength":30},"negation":{"default":false,"type":"boolean"},"parentId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"valueString":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"valueNumber":{"type":["number","null"]},"valueDate":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"valueBool":{"type":["boolean","null"]},"valueUuid":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["field","operator","negation"],"additionalProperties":false}},"leadCount":{"type":"number"},"refreshedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","emoji","filter","leadCount","refreshedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.lists_overview":{"post":{"operationId":"segmentation.lists_overview","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.lists_overview.md"},"x-mcp-tool":"segmentation_lists_overview","x-cli":"node cli/atomiks.mjs segmentation.lists_overview --json '{...}'","x-session-only":false,"summary":"Listas com contagem, compradores e receita","description":"Lista de \"Listas\" (Contatos & Comercial > Segmentação > Listas): cada lista com emoji, total de contatos, última atualização e, quando há venda, compradores (`buyersCount`) e receita (`totalRevenue`, centavos). Das atualizadas há pouco para as mais antigas; `q` filtra pelo nome. 20 por página. As vendas somam até 1 000 membros por lista.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"leadCount":{"type":"number"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":["string","null"]},"buyersCount":{"type":"number"},"totalRevenue":{"type":"number"}},"required":["id","name","emoji","leadCount","updatedAt","createdAt","source","buyersCount","totalRevenue"],"additionalProperties":false}},"total":{"type":"number"},"countPages":{"type":"number"}},"required":["items","total","countPages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.list_get":{"post":{"operationId":"segmentation.list_get","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.list_get.md"},"x-mcp-tool":"segmentation_list_get","x-cli":"node cli/atomiks.mjs segmentation.list_get --json '{...}'","x-session-only":false,"summary":"Ver uma lista","description":"Uma lista (nome, emoji, total de contatos, última atualização, fonte).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"leadCount":{"type":"number"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":["string","null"]}},"required":["id","name","emoji","leadCount","updatedAt","createdAt","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.list_create":{"post":{"operationId":"segmentation.list_create","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.list_create.md"},"x-mcp-tool":"segmentation_list_create","x-cli":"node cli/atomiks.mjs segmentation.list_create --json '{...}'","x-session-only":false,"summary":"Criar lista com emoji","description":"Cria uma lista manual com nome e emoji opcional. Nome único na conta sem diferenciar maiúsculas; repetido dá `invalid_input`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"emoji":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]}},"required":["name"]},"example":{"name":"Clientes premium","emoji":"🎯"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"leadCount":{"type":"number"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":["string","null"]}},"required":["id","name","emoji","leadCount","updatedAt","createdAt","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.list_update":{"post":{"operationId":"segmentation.list_update","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.list_update.md"},"x-mcp-tool":"segmentation_list_update","x-cli":"node cli/atomiks.mjs segmentation.list_update --json '{...}'","x-session-only":false,"summary":"Editar nome e emoji da lista","description":"Muda o nome e/ou o emoji (`null` tira o emoji). Campos omitidos não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"emoji":{"anyOf":[{"type":"string","minLength":1,"maxLength":16},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Clientes VIP"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"leadCount":{"type":"number"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":["string","null"]}},"required":["id","name","emoji","leadCount","updatedAt","createdAt","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.list_recount":{"post":{"operationId":"segmentation.list_recount","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.list_recount.md"},"x-mcp-tool":"segmentation_list_recount","x-cli":"node cli/atomiks.mjs segmentation.list_recount --json '{...}'","x-session-only":false,"summary":"Reprocessar a contagem da lista","description":"Recontar os membros da lista e marcar a atualização. A contagem do Atomiks é ao vivo; a operação existe pelo \"Reprocessar contagens\" do original e devolve a lista com o total atual.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"leadCount":{"type":"number"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"source":{"type":["string","null"]}},"required":["id","name","emoji","leadCount","updatedAt","createdAt","source"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.list_analytics":{"post":{"operationId":"segmentation.list_analytics","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.list_analytics.md"},"x-mcp-tool":"segmentation_list_analytics","x-cli":"node cli/atomiks.mjs segmentation.list_analytics --json '{...}'","x-session-only":false,"summary":"Análise de uma lista: vendas, oportunidades e mensagens","description":"Aba \"Análise\" da lista: `sales` (audiência, compradores, receita e ticket médio em centavos, `frequency` por número de compras e `monthly` compras por mês), `opportunities` (contatos com oportunidade, em aberto, ganhas e perdidas com valor, por funil) e `messages` (`whatsapp`: enviadas aos membros, entregues, lidas e com falha, com a taxa; `email` e `sms` são `null`). Lê até 5000 membros que quem pede vê.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sales":{"type":"object","properties":{"audienceCount":{"type":"number"},"buyersCount":{"type":"number"},"totalRevenue":{"type":"number"},"avgTicket":{"type":"number"},"frequency":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string"},"buyers":{"type":"number"}},"required":["bucket","buyers"],"additionalProperties":false}},"monthly":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"purchases":{"type":"number"}},"required":["month","purchases"],"additionalProperties":false}}},"required":["audienceCount","buyersCount","totalRevenue","avgTicket","frequency","monthly"],"additionalProperties":false},"opportunities":{"type":"object","properties":{"totalLeadsWithOpportunities":{"type":"number"},"open":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"won":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"lost":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"totalValue":{"type":"number"},"byPipeline":{"type":"array","items":{"type":"object","properties":{"pipelineId":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"open":{"type":"number"},"won":{"type":"number"},"lost":{"type":"number"}},"required":["pipelineId","name","count","value","open","won","lost"],"additionalProperties":false}}},"required":["totalLeadsWithOpportunities","open","won","lost","totalValue","byPipeline"],"additionalProperties":false},"messages":{"type":"object","properties":{"email":{"type":"null"},"sms":{"type":"null"},"whatsapp":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"delivered":{"type":"object","properties":{"count":{"type":"number"},"rate":{"type":["number","null"]}},"required":["count","rate"],"additionalProperties":false},"visualized":{"type":"object","properties":{"count":{"type":"number"},"rate":{"type":["number","null"]}},"required":["count","rate"],"additionalProperties":false},"failed":{"type":"object","properties":{"count":{"type":"number"},"rate":{"type":["number","null"]}},"required":["count","rate"],"additionalProperties":false}},"required":["total","delivered","visualized","failed"],"additionalProperties":false},{"type":"null"}]}},"required":["email","sms","whatsapp"],"additionalProperties":false}},"required":["sales","opportunities","messages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.tags_overview":{"post":{"operationId":"segmentation.tags_overview","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.tags_overview.md"},"x-mcp-tool":"segmentation_tags_overview","x-cli":"node cli/atomiks.mjs segmentation.tags_overview --json '{...}'","x-session-only":false,"summary":"Minhas tags com uso","description":"Aba \"Minhas tags\": cada tag com cor (hexadecimal sem \"#\"), contatos, oportunidades, automações e segmentos que a usam, formulários e quadros (sempre 0, não existem aqui) e data de criação. `q` filtra pelo nome; `orderBy` e `order` ordenam (padrão nome, crescente). 10 por página.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":40},"orderBy":{"type":"string","enum":["name","leadsCount","opportunitiesCount","flowsCount","segmentsCount","formsCount","boardsCount","createdAt"]},"order":{"type":"string","enum":["asc","desc"]},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"orderBy":"leadsCount","order":"desc"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"leadsCount":{"type":"number"},"opportunitiesCount":{"type":"number"},"flowsCount":{"type":"number"},"segmentsCount":{"type":"number"},"formsCount":{"type":"number"},"boardsCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","color","leadsCount","opportunitiesCount","flowsCount","segmentsCount","formsCount","boardsCount","createdAt"],"additionalProperties":false}},"total":{"type":"number"},"countPages":{"type":"number"}},"required":["items","total","countPages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.tag_create":{"post":{"operationId":"segmentation.tag_create","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.tag_create.md"},"x-mcp-tool":"segmentation_tag_create","x-cli":"node cli/atomiks.mjs segmentation.tag_create --json '{...}'","x-session-only":false,"summary":"Criar tag com cor em hexadecimal","description":"Cria a tag com nome (até 40) e cor hexadecimal de 6 dígitos (com ou sem \"#\"; padrão cinza). Nome único na conta sem diferenciar maiúsculas; repetido dá `invalid_input`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string"}},"required":["name"]},"example":{"name":"VIP","color":"#3B82F6"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.tag_update":{"post":{"operationId":"segmentation.tag_update","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.tag_update.md"},"x-mcp-tool":"segmentation_tag_update","x-cli":"node cli/atomiks.mjs segmentation.tag_update --json '{...}'","x-session-only":false,"summary":"Editar nome e cor da tag","description":"Renomeia e/ou muda a cor (hexadecimal de 6 dígitos). Campos omitidos não mudam.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Cliente VIP"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.tag_usage":{"post":{"operationId":"segmentation.tag_usage","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.tag_usage.md"},"x-mcp-tool":"segmentation_tag_usage","x-cli":"node cli/atomiks.mjs segmentation.tag_usage --json '{...}'","x-session-only":false,"summary":"Uso e insights de uma tag","description":"Painel da tag e confirmação de exclusão: contatos, oportunidades, automações e segmentos que a usam (`references`, com `kind` flow ou segment e o nome), `coverage` (contatos com a tag / contatos da conta), aplicações nos últimos 30 dias, `trend` (acumulado de 6 meses), `dailyApplied` (14 dias), `lastAppliedAt` e uma prévia de até 5 contatos (`leadsPreview`) que perdem a tag se ela for apagada.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"tagId":{"type":"string"},"leadsCount":{"type":"number"},"opportunitiesCount":{"type":"number"},"flowsCount":{"type":"number"},"segmentsCount":{"type":"number"},"totalLeads":{"type":"number"},"coverage":{"type":"number"},"appliedLast30Days":{"type":"number"},"usageCount":{"type":"number"},"lastAppliedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"trend":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"leads":{"type":"number"}},"required":["month","leads"],"additionalProperties":false}},"dailyApplied":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"],"additionalProperties":false}},"flows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flow","segment"]},"id":{"type":"string"},"name":{"type":"string"},"meta":{"type":["string","null"]}},"required":["kind","id","name","meta"],"additionalProperties":false}},"referencesTotal":{"type":"number"},"health":{"type":"string","enum":["healthy","attention","critical","unused"]},"leadsPreview":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]}},"required":["leadId","name","email","telephone"],"additionalProperties":false}}},"required":["id","name","color","tagId","leadsCount","opportunitiesCount","flowsCount","segmentsCount","totalLeads","coverage","appliedLast30Days","usageCount","lastAppliedAt","createdAt","updatedAt","trend","dailyApplied","flows","segments","references","referencesTotal","health","leadsPreview"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.tag_leads":{"post":{"operationId":"segmentation.tag_leads","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.tag_leads.md"},"x-mcp-tool":"segmentation_tag_leads","x-cli":"node cli/atomiks.mjs segmentation.tag_leads --json '{...}'","x-session-only":false,"summary":"Contatos que receberam a tag","description":"Aba \"Quem recebeu\": os contatos que receberam a tag, do mais recente (`appliedAt`) ao mais antigo, só os que quem pede vê. `total` conta todos que a têm.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]},"appliedAt":{"type":"string"}},"required":["leadId","name","email","telephone","appliedAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["data","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.system_tags":{"post":{"operationId":"segmentation.system_tags","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.system_tags.md"},"x-mcp-tool":"segmentation_system_tags","x-cli":"node cli/atomiks.mjs segmentation.system_tags --json '{...}'","x-session-only":false,"summary":"Tags do sistema (eventos)","description":"Aba \"Tags do sistema\": cada tipo de atividade que algum contato fez (`eventName`, ex.: crm.tag.lead.apply.v1) com a categoria, os contatos (`count`), as ocorrências, as dos últimos 7 dias e a primeira e a última vez. Vem das fontes do Histórico de atividades (as 2 000 ocorrências mais recentes de cada fonte). `q` filtra pelo nome do evento; `orderBy` (eventName, count, occurrences, occurrencesLast7Days, firstSeenAt, lastSeenAt) e `order` ordenam (padrão última atividade, decrescente).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":80},"orderBy":{"type":"string","enum":["eventName","count","occurrences","occurrencesLast7Days","firstSeenAt","lastSeenAt"]},"order":{"type":"string","enum":["asc","desc"]},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"category":{"type":"string"},"count":{"type":"number"},"occurrences":{"type":"number"},"occurrencesLast7Days":{"type":"number"},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"}},"required":["eventName","category","count","occurrences","occurrencesLast7Days","firstSeenAt","lastSeenAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.system_tag_insights":{"post":{"operationId":"segmentation.system_tag_insights","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.system_tag_insights.md"},"x-mcp-tool":"segmentation_system_tag_insights","x-cli":"node cli/atomiks.mjs segmentation.system_tag_insights --json '{...}'","x-session-only":false,"summary":"Insights de uma tag do sistema","description":"Painel do evento: `coverage` (contatos que o fizeram / contatos da conta), ocorrências (total, 7 e 30 dias), novos contatos em 30 dias, séries `daily` (30 dias) e `monthly` (6 meses), `weekdays` (domingo a sábado) e `hours` (0 a 23) no fuso da conta, `coOccurring` (outros eventos dos mesmos contatos), `topLeads` (quem mais dispara) e `flows` (automações com gatilho de entrada ou saída neste evento).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventName":{"type":"string","minLength":1,"maxLength":120}},"required":["eventName"]},"example":{"eventName":"crm.tag.lead.apply.v1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventName":{"type":"string"},"category":{"type":"string"},"totalLeads":{"type":"number"},"coverage":{"type":"number"},"leadsCount":{"type":"number"},"occurrences":{"type":"number"},"occurrencesLast7Days":{"type":"number"},"occurrencesLast30Days":{"type":"number"},"newLeadsLast30Days":{"type":"number"},"firstSeenAt":{"type":["string","null"]},"lastSeenAt":{"type":["string","null"]},"hours":{"type":"array","items":{"type":"number"}},"weekdays":{"type":"array","items":{"type":"number"}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"],"additionalProperties":false}},"monthly":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"count":{"type":"number"}},"required":["month","count"],"additionalProperties":false}},"health":{"type":"string","enum":["healthy","attention","unused"]},"coOccurrenceSample":{"type":"number"},"coOccurring":{"type":"array","items":{"type":"object","properties":{"eventName":{"type":"string"},"category":{"type":"string"},"leads":{"type":"number"},"share":{"type":"number"}},"required":["eventName","category","leads","share"],"additionalProperties":false}},"topLeads":{"type":"array","items":{"type":"object","properties":{"leadId":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]},"occurrences":{"type":"number"},"lastAt":{"type":"string"}},"required":["leadId","name","email","telephone","occurrences","lastAt"],"additionalProperties":false}},"flows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"triggerType":{"type":"string","enum":["start","exit"]},"mode":{"type":"string"}},"required":["id","name","triggerType","mode"],"additionalProperties":false}},"flowsCount":{"type":"number"}},"required":["eventName","category","totalLeads","coverage","leadsCount","occurrences","occurrencesLast7Days","occurrencesLast30Days","newLeadsLast30Days","firstSeenAt","lastSeenAt","hours","weekdays","daily","monthly","health","coOccurrenceSample","coOccurring","topLeads","flows","flowsCount"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/segmentation.system_tag_activities":{"post":{"operationId":"segmentation.system_tag_activities","tags":["segmentation"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/segmentation.system_tag_activities.md"},"x-mcp-tool":"segmentation_system_tag_activities","x-cli":"node cli/atomiks.mjs segmentation.system_tag_activities --json '{...}'","x-session-only":false,"summary":"Ocorrências de uma tag do sistema","description":"Histórico do evento (`/segments/tags/system/{eventName}`): as ocorrências, da mais recente à mais antiga, com a categoria e o contato (nome, e-mail, telefone). 20 por página. Mesmas fontes e mesmo limite de `activities.list`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventName":{"type":"string","minLength":1,"maxLength":120},"page":{"type":"integer","minimum":1,"maximum":10000},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["eventName"]},"example":{"eventName":"crm.tag.lead.apply.v1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"createdAt":{"type":"string"},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"leadEmail":{"type":["string","null"]},"leadTelephone":{"type":["string","null"]}},"required":["id","category","createdAt","leadId","leadName","leadEmail","leadTelephone"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.profile_get":{"post":{"operationId":"account.profile_get","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.profile_get.md"},"x-mcp-tool":"account_profile_get","x-cli":"node cli/atomiks.mjs account.profile_get --json '{...}'","x-session-only":false,"summary":"Ver meu perfil completo","description":"Perfil de Configurações > Meu usuário > Perfil: nome, sobrenome, e-mail (login, só leitura), telefone (com DDI), foto (`avatarUrl`) e endereço (CEP, país, estado, cidade, rua, número, bairro, complemento). Campo vazio vem como texto vazio.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"avatarUrl":{"type":["string","null"]},"zipCode":{"type":"string"},"country":{"type":"string"},"state":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"number":{"type":"string"},"neighborhood":{"type":"string"},"complement":{"type":"string"}},"required":["firstName","lastName","email","phone","avatarUrl","zipCode","country","state","city","street","number","neighborhood","complement"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.profile_update":{"post":{"operationId":"account.profile_update","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.profile_update.md"},"x-mcp-tool":"account_profile_update","x-cli":"node cli/atomiks.mjs account.profile_update --json '{...}'","x-session-only":false,"summary":"Alterar meu perfil completo","description":"Altera nome, sobrenome, telefone (`+` e 6 a 15 dígitos) e endereço do próprio usuário. Campo omitido não muda; texto vazio limpa (menos `firstName`, obrigatório). `zipCode` leva só os 8 dígitos. O nome completo mostrado à equipe (`me.profile_get`) passa a ser \"nome sobrenome\". A foto continua em `me.profile_update`.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","maxLength":100},"phone":{"type":"string","pattern":"^(\\+?\\d{6,15})?$"},"zipCode":{"type":"string","pattern":"^(\\d{8})?$"},"country":{"type":"string","maxLength":100},"state":{"type":"string","maxLength":100},"city":{"type":"string","maxLength":100},"street":{"type":"string","maxLength":200},"number":{"type":"string","maxLength":20},"neighborhood":{"type":"string","maxLength":100},"complement":{"type":"string","maxLength":100}}},"example":{"firstName":"Ana","lastName":"Souza","zipCode":"01310100"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"avatarUrl":{"type":["string","null"]},"zipCode":{"type":"string"},"country":{"type":"string"},"state":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"number":{"type":"string"},"neighborhood":{"type":"string"},"complement":{"type":"string"}},"required":["firstName","lastName","email","phone","avatarUrl","zipCode","country","state","city","street","number","neighborhood","complement"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.password_change":{"post":{"operationId":"account.password_change","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.password_change.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Trocar minha senha","description":"Confere a senha atual (`oldPassword`) e grava a nova (`password`): 8 a 32 caracteres com maiúscula, minúscula, número e um especial entre `-#$.%&*@!~`. Só pela interface (não aceita chave de API). Limite de 5 tentativas por hora.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"oldPassword":{"type":"string","minLength":1,"maxLength":200},"password":{"type":"string","maxLength":200}},"required":["oldPassword","password"]},"example":{"oldPassword":"senha-atual","password":"Nova#Senha1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.plan_get":{"post":{"operationId":"account.plan_get","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.plan_get.md"},"x-mcp-tool":"account_plan_get","x-cli":"node cli/atomiks.mjs account.plan_get --json '{...}'","x-session-only":false,"summary":"Ver o plano e o uso da conta","description":"Plano da conta atual (nome, módulos, limites de usuários, canais, contatos e dias de retenção de mídia) e o uso de cada limite: `usage.users` (membros), `usage.channels` (números conectados) e `usage.contacts`.","x-scope":"account:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"plan":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"users":{"type":"number"},"channels":{"type":"number"},"contacts":{"type":"number"},"mediaRetentionDays":{"type":"number"}},"required":["users","channels","contacts","mediaRetentionDays"],"additionalProperties":false}},"required":["key","name","isFree","modules","limits"],"additionalProperties":false},"usage":{"type":"object","properties":{"users":{"type":"number"},"channels":{"type":"number"},"contacts":{"type":"number"}},"required":["users","channels","contacts"],"additionalProperties":false}},"required":["plan","usage"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.plans_list":{"post":{"operationId":"account.plans_list","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.plans_list.md"},"x-mcp-tool":"account_plans_list","x-cli":"node cli/atomiks.mjs account.plans_list --json '{...}'","x-session-only":false,"summary":"Listar os planos do Atomiks","description":"Planos disponíveis (nome, módulos e limites) e `currentKey`, o plano da conta atual. Sem preço: a contratação não passa pelo app.","x-scope":"account:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currentKey":{"type":["string","null"]},"plans":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"isFree":{"type":"boolean"},"modules":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"users":{"type":"number"},"channels":{"type":"number"},"contacts":{"type":"number"},"mediaRetentionDays":{"type":"number"}},"required":["users","channels","contacts","mediaRetentionDays"],"additionalProperties":false}},"required":["key","name","isFree","modules","limits"],"additionalProperties":false}}},"required":["currentKey","plans"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.devices_list":{"post":{"operationId":"account.devices_list","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.devices_list.md"},"x-mcp-tool":"account_devices_list","x-cli":"node cli/atomiks.mjs account.devices_list --json '{...}'","x-session-only":false,"summary":"Listar meus dispositivos conectados","description":"Navegadores e aparelhos em que o usuário ativou os avisos (assinaturas Web Push), com nome (`Chrome no Windows`), tipo e data. Vale para todas as contas do usuário.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["Celular","Computador"]},"createdAt":{"type":"string"}},"required":["id","name","kind","createdAt"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/account.device_disconnect":{"post":{"operationId":"account.device_disconnect","tags":["account"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/account.device_disconnect.md"},"x-mcp-tool":"account_device_disconnect","x-cli":"node cli/atomiks.mjs account.device_disconnect --json '{...}'","x-session-only":false,"summary":"Desconectar um dispositivo","description":"Apaga a assinatura do dispositivo (`id` de `account.devices_list`): ele deixa de receber avisos até ser ativado de novo.","x-scope":null,"x-access":"authenticated","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_overview":{"post":{"operationId":"products.hub_overview","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_overview.md"},"x-mcp-tool":"products_hub_overview","x-cli":"node cli/atomiks.mjs products.hub_overview --json '{...}'","x-session-only":false,"summary":"Cartões e limite de Meus produtos","description":"Totais da tela Meus produtos: produtos (não arquivados), `total` (com arquivados), ofertas ativas, ofertas aguardando ajuste (incompletas) e faturamento (centavos, vendas ativas do CRM). `limit` vem de `plans.limits.products` do plano da conta; `null` quando o plano não limita.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"products":{"type":"number"},"total":{"type":"number"},"approvedOffers":{"type":"number"},"offersNeedingAttention":{"type":"number"},"revenueCents":{"type":"number"},"limit":{"type":["number","null"]}},"required":["products","total","approvedOffers","offersNeedingAttention","revenueCents","limit"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_list":{"post":{"operationId":"products.hub_list","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_list.md"},"x-mcp-tool":"products_hub_list","x-cli":"node cli/atomiks.mjs products.hub_list --json '{...}'","x-session-only":false,"summary":"Listar produtos com ofertas","description":"Produtos da conta com ofertas, status da oferta principal, vendas, faturamento e série de vendas dos últimos 30 dias. Filtros: `search` (nome ou descrição), `types`, `categories`, `statuses` (da oferta principal), `includeActive` e `includeArchived` (padrão: os dois). Ordem em `sort`; página `page`/`perPage` (10, até 50).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":100},"types":{"type":"array","items":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]}},"categories":{"type":"array","items":{"type":"string","maxLength":80}},"statuses":{"type":"array","items":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]}},"includeActive":{"type":"boolean"},"includeArchived":{"type":"boolean"},"sort":{"type":"string","enum":["newest","oldest","nameAsc","nameDesc","salesDesc","revenueDesc"]},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":50}}},"example":{"sort":"newest","page":1,"perPage":10}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]},"kind":{"type":"string","enum":["physical","digital","service"]},"category":{"type":["string","null"]},"checkoutType":{"type":"string","enum":["internal","external"]},"priceCents":{"type":"number"},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"supportEmail":{"type":["string","null"]},"supportPhone":{"type":["string","null"]},"softDescriptor":{"type":["string","null"]},"refundDays":{"type":["number","null"]},"stockQuantity":{"type":["number","null"]},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}},"salesCount":{"type":"number"},"revenueCents":{"type":"number"},"series":{"type":"array","items":{"type":"number"}}},"required":["id","name","description","type","kind","category","checkoutType","priceCents","imageUrl","archived","createdAt","supportEmail","supportPhone","softDescriptor","refundDays","stockQuantity","status","offers","salesCount","revenueCents","series"],"additionalProperties":false}},"total":{"type":"number"},"pages":{"type":"number"}},"required":["items","total","pages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_get":{"post":{"operationId":"products.hub_get","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_get.md"},"x-mcp-tool":"products_hub_get","x-cli":"node cli/atomiks.mjs products.hub_get --json '{...}'","x-session-only":false,"summary":"Detalhe do produto","description":"Produto com ofertas (cada uma com status e o que falta para ativar), vendas e faturamento.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]},"kind":{"type":"string","enum":["physical","digital","service"]},"category":{"type":["string","null"]},"checkoutType":{"type":"string","enum":["internal","external"]},"priceCents":{"type":"number"},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"supportEmail":{"type":["string","null"]},"supportPhone":{"type":["string","null"]},"softDescriptor":{"type":["string","null"]},"refundDays":{"type":["number","null"]},"stockQuantity":{"type":["number","null"]},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}},"salesCount":{"type":"number"},"revenueCents":{"type":"number"},"series":{"type":"array","items":{"type":"number"}}},"required":["id","name","description","type","kind","category","checkoutType","priceCents","imageUrl","archived","createdAt","supportEmail","supportPhone","softDescriptor","refundDays","stockQuantity","status","offers","salesCount","revenueCents","series"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_create":{"post":{"operationId":"products.hub_create","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_create.md"},"x-mcp-tool":"products_hub_create","x-cli":"node cli/atomiks.mjs products.hub_create --json '{...}'","x-session-only":false,"summary":"Criar produto com oferta principal","description":"Cria o produto e a oferta principal (`priceCents` mínimo 500, `recurrence` para assinatura; produto físico só aceita pagamento único e exige `quantity`). `limit_reached` quando o plano define `plans.limits.products` e a conta já usa todos. A oferta nasce inativa até estar completa.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"type":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":50,"maxLength":1000},"category":{"type":"string","maxLength":80},"priceCents":{"type":"integer","minimum":500,"maximum":9007199254740991},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"]},{"type":"null"}]},"quantity":{"type":"integer","minimum":0,"maximum":100},"checkoutType":{"type":"string","enum":["internal","external"]}},"required":["type","name","description","category","priceCents"]},"example":{"type":"course","name":"Curso de vendas","description":"Aulas gravadas para quem quer aprender a vender mais pelo WhatsApp, passo a passo.","category":"Educacional","priceCents":49700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]},"kind":{"type":"string","enum":["physical","digital","service"]},"category":{"type":["string","null"]},"checkoutType":{"type":"string","enum":["internal","external"]},"priceCents":{"type":"number"},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"supportEmail":{"type":["string","null"]},"supportPhone":{"type":["string","null"]},"softDescriptor":{"type":["string","null"]},"refundDays":{"type":["number","null"]},"stockQuantity":{"type":["number","null"]},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}},"salesCount":{"type":"number"},"revenueCents":{"type":"number"},"series":{"type":"array","items":{"type":"number"}}},"required":["id","name","description","type","kind","category","checkoutType","priceCents","imageUrl","archived","createdAt","supportEmail","supportPhone","softDescriptor","refundDays","stockQuantity","status","offers","salesCount","revenueCents","series"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_update":{"post":{"operationId":"products.hub_update","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_update.md"},"x-mcp-tool":"products_hub_update","x-cli":"node cli/atomiks.mjs products.hub_update --json '{...}'","x-session-only":false,"summary":"Alterar produto","description":"Altera os campos informados; o tipo não muda depois de criado. `null` limpa suporte, descritor e prazo de reembolso. `stockQuantity` é o estoque do produto físico.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":50,"maxLength":1000},"category":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"supportEmail":{"anyOf":[{"type":"string","maxLength":200,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"supportPhone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"softDescriptor":{"anyOf":[{"type":"string","maxLength":22},{"type":"null"}]},"refundDays":{"anyOf":[{"type":"integer","minimum":0,"maximum":90},{"type":"null"}]},"stockQuantity":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"checkoutType":{"type":"string","enum":["internal","external"]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","softDescriptor":"MINHA MARCA"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["course","community","ebook","mentorship","event","software","physical","other"]},"kind":{"type":"string","enum":["physical","digital","service"]},"category":{"type":["string","null"]},"checkoutType":{"type":"string","enum":["internal","external"]},"priceCents":{"type":"number"},"imageUrl":{"type":["string","null"]},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"supportEmail":{"type":["string","null"]},"supportPhone":{"type":["string","null"]},"softDescriptor":{"type":["string","null"]},"refundDays":{"type":["number","null"]},"stockQuantity":{"type":["number","null"]},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}},"salesCount":{"type":"number"},"revenueCents":{"type":"number"},"series":{"type":"array","items":{"type":"number"}}},"required":["id","name","description","type","kind","category","checkoutType","priceCents","imageUrl","archived","createdAt","supportEmail","supportPhone","softDescriptor","refundDays","stockQuantity","status","offers","salesCount","revenueCents","series"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_delete":{"post":{"operationId":"products.hub_delete","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_delete.md"},"x-mcp-tool":"products_hub_delete","x-cli":"node cli/atomiks.mjs products.hub_delete --json '{...}'","x-session-only":false,"summary":"Excluir produto","description":"Exclui o produto, as ofertas, os entregáveis e os cupons. Produto com vendas registradas não é excluído (`invalid_input`): arquive. Oportunidades e vendas antigas perdem o vínculo.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.offer_save":{"post":{"operationId":"products.offer_save","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.offer_save.md"},"x-mcp-tool":"products_offer_save","x-cli":"node cli/atomiks.mjs products.offer_save --json '{...}'","x-session-only":false,"summary":"Criar ou editar oferta","description":"Sem `id` cria uma oferta nova (inativa); com `id` altera nome, preço (`priceCents`, mínimo 500), preço promocional (`newPriceCents`, menor que o preço) e recorrência. A oferta principal mantém o preço do produto no CRM.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"priceCents":{"type":"integer","minimum":500,"maximum":9007199254740991},"newPriceCents":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"]},{"type":"null"}]}},"required":["productId","name","priceCents"]},"example":{"productId":"00000000-0000-0000-0000-000000000000","name":"Oferta de lançamento","priceCents":29700}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.offer_set_active":{"post":{"operationId":"products.offer_set_active","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.offer_set_active.md"},"x-mcp-tool":"products_offer_set_active","x-cli":"node cli/atomiks.mjs products.offer_set_active --json '{...}'","x-session-only":false,"summary":"Ativar ou desativar oferta","description":"Ativa a oferta quando está completa (`incompleteReason` vazio); senão `invalid_input` com o que falta. É só o estado no Atomiks: não há publicação em gateway nem link de pagamento.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"active":{"type":"boolean"}},"required":["id","active"]},"example":{"id":"00000000-0000-0000-0000-000000000000","active":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.offer_archive":{"post":{"operationId":"products.offer_archive","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.offer_archive.md"},"x-mcp-tool":"products_offer_archive","x-cli":"node cli/atomiks.mjs products.offer_archive --json '{...}'","x-session-only":false,"summary":"Arquivar ou desarquivar oferta","description":"Arquiva (`archived: true`) ou restaura a oferta; arquivar também a desativa. A oferta principal não é arquivada: arquive o produto.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archived":{"type":"boolean"}},"required":["id","archived"]},"example":{"id":"00000000-0000-0000-0000-000000000000","archived":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"name":{"type":"string"},"isMain":{"type":"boolean"},"status":{"type":"string","enum":["incomplete","ready_to_submit","approved","archived"]},"priceCents":{"type":"number"},"newPriceCents":{"type":["number","null"]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly","quarterly","semi-annually","yearly"]},"intervalMonths":{"type":"integer","minimum":1,"maximum":12},"trialDays":{"type":"integer","minimum":0,"maximum":180}},"required":["frequency","intervalMonths","trialDays"],"additionalProperties":false},{"type":"null"}]},"incompleteReason":{"type":"array","items":{"type":"string"}},"hasCoupon":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","productId","name","isMain","status","priceCents","newPriceCents","recurrence","incompleteReason","hasCoupon","archived"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.offer_delete":{"post":{"operationId":"products.offer_delete","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.offer_delete.md"},"x-mcp-tool":"products_offer_delete","x-cli":"node cli/atomiks.mjs products.offer_delete --json '{...}'","x-session-only":false,"summary":"Excluir oferta","description":"Exclui uma oferta que não seja a principal. Os cupons só dela perdem o vínculo e ela some dos entregáveis.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.deliverable_list":{"post":{"operationId":"products.deliverable_list","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.deliverable_list.md"},"x-mcp-tool":"products_deliverable_list","x-cli":"node cli/atomiks.mjs products.deliverable_list --json '{...}'","x-session-only":false,"summary":"Entregáveis do produto","description":"Entregáveis do produto (`offerId` nulo vale para todas as ofertas) e os só de uma oferta, com `exclusions`: por oferta, os entregáveis do produto que ela não entrega.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["productId"]},"example":{"productId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"offerId":{"type":["string","null"]},"category":{"type":"string","enum":["file","link","event","email","membership","internal_membership","webhook"]},"name":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string"}},"required":["id","productId","offerId","category","name","config","createdAt"],"additionalProperties":false}},"exclusions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["items","exclusions"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.deliverable_save":{"post":{"operationId":"products.deliverable_save","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.deliverable_save.md"},"x-mcp-tool":"products_deliverable_save","x-cli":"node cli/atomiks.mjs products.deliverable_save --json '{...}'","x-session-only":false,"summary":"Criar ou editar entregável","description":"Sem `id` cria; com `id` altera nome, categoria e `config` (link, e-mail, webhook, evento ou área de membros: o que a categoria pede). `offerId` cria um entregável só daquela oferta. O Atomiks não entrega nada sozinho: guarda o que a oferta promete.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"offerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"category":{"type":"string","enum":["file","link","event","email","membership","internal_membership","webhook"]},"name":{"type":"string","minLength":1,"maxLength":120},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["productId","category","name"]},"example":{"productId":"00000000-0000-0000-0000-000000000000","category":"link","name":"Acesso ao curso","config":{"url":"https://exemplo.com/curso"}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"offerId":{"type":["string","null"]},"category":{"type":"string","enum":["file","link","event","email","membership","internal_membership","webhook"]},"name":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string"}},"required":["id","productId","offerId","category","name","config","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.deliverable_delete":{"post":{"operationId":"products.deliverable_delete","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.deliverable_delete.md"},"x-mcp-tool":"products_deliverable_delete","x-cli":"node cli/atomiks.mjs products.deliverable_delete --json '{...}'","x-session-only":false,"summary":"Excluir entregável","description":"Exclui o entregável do produto ou da oferta. Ofertas já ativas que ficariam sem nenhum entregável (tipo que exige) voltam a ficar inativas.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.offer_deliverables_set":{"post":{"operationId":"products.offer_deliverables_set","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.offer_deliverables_set.md"},"x-mcp-tool":"products_offer_deliverables_set","x-cli":"node cli/atomiks.mjs products.offer_deliverables_set --json '{...}'","x-session-only":false,"summary":"Definir o que a oferta não entrega","description":"Troca a lista de entregáveis do produto que a oferta NÃO entrega (`excludedIds`). A oferta principal herda tudo e não aceita exclusões.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"offerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"excludedIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["offerId","excludedIds"]},"example":{"offerId":"00000000-0000-0000-0000-000000000000","excludedIds":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.coupon_list":{"post":{"operationId":"products.coupon_list","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.coupon_list.md"},"x-mcp-tool":"products_coupon_list","x-cli":"node cli/atomiks.mjs products.coupon_list --json '{...}'","x-session-only":false,"summary":"Cupons do produto","description":"Cupons de desconto do produto (percentual ou valor fixo em centavos) com uso, validade e público.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["productId"]},"example":{"productId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"code":{"type":"string"},"discountType":{"type":"string","enum":["percentage","fixed"]},"discountValue":{"type":"number"},"active":{"type":"boolean"},"maxUses":{"type":["number","null"]},"usedCount":{"type":"number"},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"offerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"audience":{"type":"string","enum":["everyone","email_list","offer_buyers"]},"allowedEmails":{"type":"array","items":{"type":"string"}},"requiredOfferIds":{"type":"array","items":{"type":"string"}},"requiredMatch":{"type":"string","enum":["any","all"]}},"required":["id","productId","code","discountType","discountValue","active","maxUses","usedCount","startsAt","endsAt","offerIds","audience","allowedEmails","requiredOfferIds","requiredMatch"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.coupon_save":{"post":{"operationId":"products.coupon_save","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.coupon_save.md"},"x-mcp-tool":"products_coupon_save","x-cli":"node cli/atomiks.mjs products.coupon_save --json '{...}'","x-session-only":false,"summary":"Criar ou editar cupom","description":"Código sem espaços, único na conta (sem diferenciar maiúsculas). `discountValue`: 1 a 100 para `percentage`; centavos para `fixed`. `offerIds` nulo vale para todas as ofertas. O Atomiks não tem checkout: o cupom fica guardado, sem aplicar desconto a pagamento.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","minLength":2,"maxLength":40,"pattern":"^\\S+$"},"discountType":{"type":"string","enum":["percentage","fixed"]},"discountValue":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxUses":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"startsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"offerIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"audience":{"type":"string","enum":["everyone","email_list","offer_buyers"]},"allowedEmails":{"maxItems":500,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"requiredOfferIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"requiredMatch":{"type":"string","enum":["any","all"]}},"required":["productId","code","discountType","discountValue"]},"example":{"productId":"00000000-0000-0000-0000-000000000000","code":"DESCONTO10","discountType":"percentage","discountValue":10}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"code":{"type":"string"},"discountType":{"type":"string","enum":["percentage","fixed"]},"discountValue":{"type":"number"},"active":{"type":"boolean"},"maxUses":{"type":["number","null"]},"usedCount":{"type":"number"},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"offerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"audience":{"type":"string","enum":["everyone","email_list","offer_buyers"]},"allowedEmails":{"type":"array","items":{"type":"string"}},"requiredOfferIds":{"type":"array","items":{"type":"string"}},"requiredMatch":{"type":"string","enum":["any","all"]}},"required":["id","productId","code","discountType","discountValue","active","maxUses","usedCount","startsAt","endsAt","offerIds","audience","allowedEmails","requiredOfferIds","requiredMatch"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.coupon_set_active":{"post":{"operationId":"products.coupon_set_active","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.coupon_set_active.md"},"x-mcp-tool":"products_coupon_set_active","x-cli":"node cli/atomiks.mjs products.coupon_set_active --json '{...}'","x-session-only":false,"summary":"Ativar ou desativar cupom","description":"Liga ou desliga o cupom sem apagar o histórico de uso.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"active":{"type":"boolean"}},"required":["id","active"]},"example":{"id":"00000000-0000-0000-0000-000000000000","active":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"code":{"type":"string"},"discountType":{"type":"string","enum":["percentage","fixed"]},"discountValue":{"type":"number"},"active":{"type":"boolean"},"maxUses":{"type":["number","null"]},"usedCount":{"type":"number"},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"offerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"audience":{"type":"string","enum":["everyone","email_list","offer_buyers"]},"allowedEmails":{"type":"array","items":{"type":"string"}},"requiredOfferIds":{"type":"array","items":{"type":"string"}},"requiredMatch":{"type":"string","enum":["any","all"]}},"required":["id","productId","code","discountType","discountValue","active","maxUses","usedCount","startsAt","endsAt","offerIds","audience","allowedEmails","requiredOfferIds","requiredMatch"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.coupon_delete":{"post":{"operationId":"products.coupon_delete","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.coupon_delete.md"},"x-mcp-tool":"products_coupon_delete","x-cli":"node cli/atomiks.mjs products.coupon_delete --json '{...}'","x-session-only":false,"summary":"Excluir cupom","description":"Exclui o cupom. Para só pausar, use `products.coupon_set_active`.","x-scope":"crm:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_dashboard":{"post":{"operationId":"products.hub_dashboard","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_dashboard.md"},"x-mcp-tool":"products_hub_dashboard","x-cli":"node cli/atomiks.mjs products.hub_dashboard --json '{...}'","x-session-only":false,"summary":"Dashboard do produto","description":"Faturamento (centavos) por dia entre `from` e `to` (ISO) e os totais do dia, do período e de todo o tempo, sobre as vendas ativas do CRM desse produto (`sales`).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","from","to"]},"example":{"id":"00000000-0000-0000-0000-000000000000","from":"2026-10-01T00:00:00.000Z","to":"2026-10-31T23:59:59.999Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chart":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"revenueCents":{"type":"number"}},"required":["day","revenueCents"],"additionalProperties":false}},"today":{"type":"object","properties":{"revenueCents":{"type":"number"},"sales":{"type":"number"}},"required":["revenueCents","sales"],"additionalProperties":false},"period":{"type":"object","properties":{"revenueCents":{"type":"number"},"sales":{"type":"number"}},"required":["revenueCents","sales"],"additionalProperties":false},"total":{"type":"object","properties":{"revenueCents":{"type":"number"},"sales":{"type":"number"}},"required":["revenueCents","sales"],"additionalProperties":false}},"required":["chart","today","period","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products.hub_sales":{"post":{"operationId":"products.hub_sales","tags":["products"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/products.hub_sales.md"},"x-mcp-tool":"products_hub_sales","x-cli":"node cli/atomiks.mjs products.hub_sales --json '{...}'","x-session-only":false,"summary":"Vendas do produto","description":"Vendas do CRM desse produto, as 100 mais recentes, com contato (nome), valor (centavos), origem e se foram canceladas. A RLS de contato decide o que aparece.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"valueCents":{"type":"number"},"source":{"type":"string"},"soldAt":{"type":"string"},"cancelled":{"type":"boolean"}},"required":["id","contactId","contactName","valueCents","source","soldAt","cancelled"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.list":{"post":{"operationId":"activities_board.list","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.list.md"},"x-mcp-tool":"activities_board_list","x-cli":"node cli/atomiks.mjs activities_board.list --json '{...}'","x-session-only":false,"summary":"Listar atividades (tarefas e reuniões)","description":"Tarefas e reuniões dos contatos que o chamador vê, com os filtros da tela Atividades. `bucket`: `ongoing` (abertas, da mais próxima para a mais distante, sem data por último), `done` (concluídas, da mais recente) ou omitido (todas, por prazo). Paginado: `page`, `perPage` (40, até 1000); `total` é a contagem do filtro.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"types":{"maxItems":5,"type":"array","items":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]}},"pipelineIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"overdue":{"type":"boolean"},"overdueBefore":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"allDayStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":40},"operator":{"type":"string","maxLength":30},"value":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}}},"required":["field","operator","value"]}}},"required":["matcher","conditions"]}},"search":{"type":"string","maxLength":120},"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"withoutDeadline":{"type":"boolean"},"bucket":{"type":"string","enum":["ongoing","done"]},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":1000}}},"example":{"bucket":"ongoing"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["task","appointment"]},"type":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]},"title":{"type":"string"},"startAt":{"type":["string","null"]},"endAt":{"type":["string","null"]},"allDay":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"status":{"type":"string","enum":["open","scheduled","resolved","cancelled","completed"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"leadId":{"type":"string"},"opportunityCardId":{"type":["string","null"]},"opportunityCardTitle":{"type":["string","null"]},"opportunityPipelineId":{"type":["string","null"]},"opportunityPipelineName":{"type":["string","null"]},"notes":{"type":["string","null"]},"meetingLink":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}},"attendantId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"outcome":{"type":["boolean","null"]},"outcomeNote":{"type":["string","null"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"conversationId":{"type":["string","null"]}},"required":["id","kind","type","title","startAt","endAt","allDay","durationMinutes","status","contactName","contactEmail","contactPhone","leadId","opportunityCardId","opportunityCardTitle","opportunityPipelineId","opportunityPipelineName","notes","meetingLink","guests","attendantId","attendantName","outcome","outcomeNote","priority","conversationId"],"additionalProperties":false}},"total":{"type":"number"},"pages":{"type":"number"},"page":{"type":"number"}},"required":["items","total","pages","page"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.summary":{"post":{"operationId":"activities_board.summary","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.summary.md"},"x-mcp-tool":"activities_board_summary","x-cli":"node cli/atomiks.mjs activities_board.summary --json '{...}'","x-session-only":false,"summary":"Contagens da tela Atividades","description":"Com os mesmos filtros da lista: `total`, `ongoing` (abertas), `done` (concluídas) e `overdue` (abertas com o horário vencido; \"Atrasadas\").","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"types":{"maxItems":5,"type":"array","items":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]}},"pipelineIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"overdue":{"type":"boolean"},"overdueBefore":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"allDayStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":40},"operator":{"type":"string","maxLength":30},"value":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}}},"required":["field","operator","value"]}}},"required":["matcher","conditions"]}},"search":{"type":"string","maxLength":120},"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"withoutDeadline":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"total":{"type":"number"},"ongoing":{"type":"number"},"done":{"type":"number"},"overdue":{"type":"number"}},"required":["total","ongoing","done","overdue"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.calendar":{"post":{"operationId":"activities_board.calendar","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.calendar.md"},"x-mcp-tool":"activities_board_calendar","x-cli":"node cli/atomiks.mjs activities_board.calendar --json '{...}'","x-session-only":false,"summary":"Atividades do calendário por dia","description":"Atividades com prazo entre `startDate` e `endDate`, agrupadas por dia no fuso `timeZone` (IANA; o do navegador). Cada dia traz até `perDay` itens (12) e `total` com todos, para o \"+ N mais\".","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"types":{"maxItems":5,"type":"array","items":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]}},"pipelineIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"overdue":{"type":"boolean"},"overdueBefore":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"allDayStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":40},"operator":{"type":"string","maxLength":30},"value":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}}},"required":["field","operator","value"]}}},"required":["matcher","conditions"]}},"search":{"type":"string","maxLength":120},"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"withoutDeadline":{"type":"boolean"},"timeZone":{"type":"string","maxLength":64},"perDay":{"type":"integer","minimum":1,"maximum":100}}},"example":{"startDate":"2026-10-01T00:00:00.000Z","endDate":"2026-10-31T23:59:59.999Z"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["task","appointment"]},"type":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]},"title":{"type":"string"},"startAt":{"type":["string","null"]},"endAt":{"type":["string","null"]},"allDay":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"status":{"type":"string","enum":["open","scheduled","resolved","cancelled","completed"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"leadId":{"type":"string"},"opportunityCardId":{"type":["string","null"]},"opportunityCardTitle":{"type":["string","null"]},"opportunityPipelineId":{"type":["string","null"]},"opportunityPipelineName":{"type":["string","null"]},"notes":{"type":["string","null"]},"meetingLink":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}},"attendantId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"outcome":{"type":["boolean","null"]},"outcomeNote":{"type":["string","null"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"conversationId":{"type":["string","null"]}},"required":["id","kind","type","title","startAt","endAt","allDay","durationMinutes","status","contactName","contactEmail","contactPhone","leadId","opportunityCardId","opportunityCardTitle","opportunityPipelineId","opportunityPipelineName","notes","meetingLink","guests","attendantId","attendantName","outcome","outcomeNote","priority","conversationId"],"additionalProperties":false}}},"required":["date","total","items"],"additionalProperties":false}}},"required":["days"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.export":{"post":{"operationId":"activities_board.export","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.export.md"},"x-mcp-tool":"activities_board_export","x-cli":"node cli/atomiks.mjs activities_board.export --json '{...}'","x-session-only":false,"summary":"Exportar atividades em CSV","description":"CSV (UTF-8 com BOM) das atividades que passam nos filtros, até 5 mil: tipo, título, prazo (fuso da conta), situação, contato, e-mail, telefone, pipeline, oportunidade e atendente. Devolve o texto em `csv`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"types":{"maxItems":5,"type":"array","items":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]}},"pipelineIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"overdue":{"type":"boolean"},"overdueBefore":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"allDayStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"matcher":{"type":"string","enum":["all","any"]},"connector":{"type":"string","enum":["and","or"]},"conditions":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","maxLength":40},"operator":{"type":"string","maxLength":30},"value":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}}},"required":["field","operator","value"]}}},"required":["matcher","conditions"]}},"search":{"type":"string","maxLength":120},"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"withoutDeadline":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.set_outcome":{"post":{"operationId":"activities_board.set_outcome","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.set_outcome.md"},"x-mcp-tool":"activities_board_set_outcome","x-cli":"node cli/atomiks.mjs activities_board.set_outcome --json '{...}'","x-session-only":false,"summary":"Concluir, cancelar ou reabrir uma atividade","description":"`done: true` conclui; `outcome: false` marca como não resolvida (tarefa) ou cancelada (reunião) e guarda `outcomeNote` (o motivo); `done: false` reabre e limpa o resultado. Sem a migration de atividades, concluir funciona e cancelar responde `migration_pendente`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"done":{"type":"boolean"},"outcome":{"type":["boolean","null"]},"outcomeNote":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["id","done"]},"example":{"id":"00000000-0000-0000-0000-000000000000","done":true,"outcome":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["task","appointment"]},"type":{"type":"string","enum":["call","whatsapp","meeting","task","appointment"]},"title":{"type":"string"},"startAt":{"type":["string","null"]},"endAt":{"type":["string","null"]},"allDay":{"type":"boolean"},"durationMinutes":{"type":["number","null"]},"status":{"type":"string","enum":["open","scheduled","resolved","cancelled","completed"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"contactPhone":{"type":["string","null"]},"leadId":{"type":"string"},"opportunityCardId":{"type":["string","null"]},"opportunityCardTitle":{"type":["string","null"]},"opportunityPipelineId":{"type":["string","null"]},"opportunityPipelineName":{"type":["string","null"]},"notes":{"type":["string","null"]},"meetingLink":{"type":["string","null"]},"guests":{"type":"array","items":{"type":"string"}},"attendantId":{"type":["string","null"]},"attendantName":{"type":["string","null"]},"outcome":{"type":["boolean","null"]},"outcomeNote":{"type":["string","null"]},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"conversationId":{"type":["string","null"]}},"required":["id","kind","type","title","startAt","endAt","allDay","durationMinutes","status","contactName","contactEmail","contactPhone","leadId","opportunityCardId","opportunityCardTitle","opportunityPipelineId","opportunityPipelineName","notes","meetingLink","guests","attendantId","attendantName","outcome","outcomeNote","priority","conversationId"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.bulk_outcome":{"post":{"operationId":"activities_board.bulk_outcome","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.bulk_outcome.md"},"x-mcp-tool":"activities_board_bulk_outcome","x-cli":"node cli/atomiks.mjs activities_board.bulk_outcome --json '{...}'","x-session-only":false,"summary":"Concluir ou cancelar várias atividades","description":"`action: completed` conclui com resultado positivo; `cancelled` fecha como não resolvida/cancelada com o mesmo `reason`. Até 200. Cada uma é independente: `failed` conta as que o chamador não vê ou não puderam mudar.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"action":{"type":"string","enum":["completed","cancelled"]},"reason":{"type":"string","maxLength":2000}},"required":["ids","action"]},"example":{"ids":["00000000-0000-0000-0000-000000000000"],"action":"completed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"succeeded":{"type":"number"},"failed":{"type":"number"}},"required":["succeeded","failed"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activities_board.opportunity_options":{"post":{"operationId":"activities_board.opportunity_options","tags":["activities_board"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/activities_board.opportunity_options.md"},"x-mcp-tool":"activities_board_opportunity_options","x-cli":"node cli/atomiks.mjs activities_board.opportunity_options --json '{...}'","x-session-only":false,"summary":"Oportunidades para vincular a uma atividade","description":"Oportunidades abertas dos contatos que o chamador vê, mais recentes primeiro, com o contato e o pipeline. `q` filtra por título, contato ou telefone; `contactId` limita a um contato. Até 30.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":120},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{"q":"proposta"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"pipelineName":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","title","contactId","contactName","pipelineName","status"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.list":{"post":{"operationId":"roles.list","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.list.md"},"x-mcp-tool":"roles_list","x-cli":"node cli/atomiks.mjs roles.list --json '{...}'","x-session-only":false,"summary":"Lista os cargos e quem os tem","description":"Cargos fixos (Administrador, Membro) e nomeados, na ordem da matriz, cada um com o acesso do Atomiks (módulos, telas, canais) e as pessoas que o têm. `writable` é falso antes da migration dos cargos.","x-scope":"team:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fixed":{"type":"boolean"},"position":{"type":"number"},"permissions":{"type":"object","properties":{"modules":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"screens":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]},"channels":{"anyOf":[{"type":"string","const":"*"},{"type":"array","items":{"type":"string"}}]}},"required":["modules","screens","channels"],"additionalProperties":false},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"imageUrl":{"type":["string","null"]}},"required":["id","name","email","imageUrl"],"additionalProperties":false}}},"required":["id","name","fixed","position","permissions","members"],"additionalProperties":false}},"writable":{"type":"boolean"}},"required":["roles","writable"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.create":{"post":{"operationId":"roles.create","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.create.md"},"x-mcp-tool":"roles_create","x-cli":"node cli/atomiks.mjs roles.create --json '{...}'","x-session-only":false,"summary":"Cria um cargo","description":"Do zero (só as telas pessoais) ou de um modelo do original (operator, collaborator, attendant, finance, guest). Nome repetido responde `invalid_input`.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"template":{"anyOf":[{"type":"string","enum":["operator","collaborator","attendant","finance","guest"]},{"type":"null"}]}},"required":["name"]},"example":{"name":"Atendimento","template":"attendant"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.update":{"post":{"operationId":"roles.update","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.update.md"},"x-mcp-tool":"roles_update","x-cli":"node cli/atomiks.mjs roles.update --json '{...}'","x-session-only":false,"summary":"Renomeia um cargo ou muda as telas dele","description":"Cargos fixos não mudam (`forbidden`). Mudar as telas regrava o acesso de quem tem o cargo.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":80},"screens":{"type":"array","items":{"type":"string"}}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","name":"Atendimento"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.delete":{"post":{"operationId":"roles.delete","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.delete.md"},"x-mcp-tool":"roles_delete","x-cli":"node cli/atomiks.mjs roles.delete --json '{...}'","x-session-only":false,"summary":"Exclui um cargo","description":"Cargos fixos não saem. Quem tinha o cargo passa a ter só os outros; sem nenhum outro, mantém o acesso atual.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.duplicate":{"post":{"operationId":"roles.duplicate","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.duplicate.md"},"x-mcp-tool":"roles_duplicate","x-cli":"node cli/atomiks.mjs roles.duplicate --json '{...}'","x-session-only":false,"summary":"Duplica um cargo","description":"A cópia leva as mesmas telas e nasce logo depois do original; as pessoas não vêm junto. Vale também para os cargos fixos.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["id","name"]},"example":{"id":"fixed:member","name":"Membro (cópia)"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.reorder":{"post":{"operationId":"roles.reorder","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.reorder.md"},"x-mcp-tool":"roles_reorder","x-cli":"node cli/atomiks.mjs roles.reorder --json '{...}'","x-session-only":false,"summary":"Reordena os cargos nomeados","description":"Recebe os ids dos cargos nomeados na nova ordem da matriz. Os fixos ficam sempre à frente e são ignorados.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]},"example":{"ids":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/roles.set_members":{"post":{"operationId":"roles.set_members","tags":["roles"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/roles.set_members.md"},"x-mcp-tool":"roles_set_members","x-cli":"node cli/atomiks.mjs roles.set_members --json '{...}'","x-session-only":false,"summary":"Define quem tem um cargo","description":"Troca a lista de pessoas do cargo (só membros com papel `user`; administradores têm acesso total). Quem entra ou sai recebe o acesso novo no próximo carregamento.","x-scope":"team:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1},"userIds":{"type":"array","items":{"type":"string"}}},"required":["id","userIds"]},"example":{"id":"00000000-0000-0000-0000-000000000000","userIds":[]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/getting_started.get":{"post":{"operationId":"getting_started.get","tags":["getting_started"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/getting_started.get.md"},"x-mcp-tool":"getting_started_get","x-cli":"node cli/atomiks.mjs getting_started.get --json '{...}'","x-session-only":false,"summary":"Ver Configurações › Primeiros passos","description":"Estado da tela Primeiros passos para o próprio usuário na conta atual: `hidden` (o usuário escondeu o checklist; mesma preferência de onboarding.dismiss) e `milestones`, o mapa marco → feito dos marcos que têm equivalente no Atomiks (produto, oferta, WhatsApp conectado, automação, pipeline, oportunidade, primeira venda). Marco que não vem no mapa ainda não existe no Atomiks.","x-scope":null,"x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hidden":{"type":"boolean"},"milestones":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}}},"required":["hidden","milestones"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/proposals.list":{"post":{"operationId":"proposals.list","tags":["proposals"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/proposals.list.md"},"x-mcp-tool":"proposals_list","x-cli":"node cli/atomiks.mjs proposals.list --json '{...}'","x-session-only":false,"summary":"Listar propostas","description":"Propostas consolidadas da conta, com contato, oportunidade (valor em centavos) e modelo. Filtros combinados com E: `statuses`, `kinds`, `templateIds` (qualquer um dentro de cada lista), `viewed` e `hasOpportunity`; `search` procura no título e no nome do contato. Ordem por `orderBy` (`createdAt` padrão, `viewedAt`, `title`) e `orderByMode`. Sem a migration do banco devolve a lista vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"default":20,"type":"integer","minimum":1,"maximum":2000},"orderBy":{"default":"createdAt","type":"string","enum":["createdAt","viewedAt","title"]},"orderByMode":{"default":"desc","type":"string","enum":["asc","desc"]},"search":{"type":"string","maxLength":100},"statuses":{"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","sent","viewed","accepted","rejected","expired"]}},"kinds":{"maxItems":3,"type":"array","items":{"type":"string","enum":["slide_deck","document","pdf"]}},"templateIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"viewed":{"type":"boolean"},"hasOpportunity":{"type":"boolean"}}},"example":{"page":1,"perPage":20,"orderBy":"createdAt","orderByMode":"desc","statuses":["sent"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["slide_deck","document","pdf"]},"status":{"type":"string","enum":["draft","sent","viewed","accepted","rejected","expired"]},"coverHtml":{"type":["string","null"]},"templateId":{"type":["string","null"]},"templateName":{"type":["string","null"]},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"opportunityTitle":{"type":["string","null"]},"opportunityValue":{"type":["number","null"]},"viewedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","slug","title","kind","status","coverHtml","templateId","templateName","leadId","leadName","opportunityId","opportunityTitle","opportunityValue","viewedAt","createdAt"],"additionalProperties":false}},"total":{"type":"number"},"pages":{"type":"number"}},"required":["items","total","pages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/proposals.create":{"post":{"operationId":"proposals.create","tags":["proposals"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/proposals.create.md"},"x-mcp-tool":"proposals_create","x-cli":"node cli/atomiks.mjs proposals.create --json '{...}'","x-session-only":false,"summary":"Consolidar proposta","description":"Gera uma proposta a partir de um modelo ativo, para um contato (`contactId`) e, se houver, uma oportunidade dele (`opportunityId`). A proposta nasce em rascunho, com o título e a capa do modelo. O link público ainda não existe no Atomiks: `slug` é o identificador reservado para ele. Sem a migration do banco responde `migration_pendente`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"templateId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["templateId"]},"example":{"templateId":"00000000-0000-0000-0000-000000000000","contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["slide_deck","document","pdf"]},"status":{"type":"string","enum":["draft","sent","viewed","accepted","rejected","expired"]},"coverHtml":{"type":["string","null"]},"templateId":{"type":["string","null"]},"templateName":{"type":["string","null"]},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"opportunityId":{"type":["string","null"]},"opportunityTitle":{"type":["string","null"]},"opportunityValue":{"type":["number","null"]},"viewedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","slug","title","kind","status","coverHtml","templateId","templateName","leadId","leadName","opportunityId","opportunityTitle","opportunityValue","viewedAt","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/proposals.templates_list":{"post":{"operationId":"proposals.templates_list","tags":["proposals"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/proposals.templates_list.md"},"x-mcp-tool":"proposals_templates_list","x-cli":"node cli/atomiks.mjs proposals.templates_list --json '{...}'","x-session-only":false,"summary":"Listar modelos de proposta","description":"Modelos de proposta da conta, do mais recente ao mais antigo. Filtros: `search` (nome), `kind`, `status`; `library: true` traz só os que podem gerar proposta (ativos, slide deck ou documento). `stats` conta tudo da conta (total, ativos, rascunhos e slide decks), sem os filtros. Sem a migration do banco devolve a lista vazia.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"default":20,"type":"integer","minimum":1,"maximum":2000},"search":{"type":"string","maxLength":100},"kind":{"type":"string","enum":["slide_deck","document","pdf"]},"status":{"type":"string","enum":["draft","active","archived"]},"library":{"type":"boolean"}}},"example":{"page":1,"perPage":20,"library":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["slide_deck","document","pdf"]},"status":{"type":"string","enum":["draft","active","archived"]},"coverHtml":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","kind","status","coverHtml","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"number"},"pages":{"type":"number"},"stats":{"type":"object","properties":{"total":{"type":"number"},"active":{"type":"number"},"drafts":{"type":"number"},"slideDeck":{"type":"number"}},"required":["total","active","drafts","slideDeck"],"additionalProperties":false}},"required":["items","total","pages","stats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/proposals.template_create":{"post":{"operationId":"proposals.template_create","tags":["proposals"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/proposals.template_create.md"},"x-mcp-tool":"proposals_template_create","x-cli":"node cli/atomiks.mjs proposals.template_create --json '{...}'","x-session-only":false,"summary":"Criar modelo de proposta","description":"Cria um modelo em rascunho (slide deck ou documento). O conteúdo é montado no editor visual, que ainda não existe no Atomiks: até lá o modelo guarda só nome, descrição e tipo. Sem a migration do banco responde `migration_pendente`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"kind":{"default":"slide_deck","type":"string","enum":["slide_deck","document"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["name"]},"example":{"name":"Proposta comercial","kind":"document"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["slide_deck","document","pdf"]},"status":{"type":"string","enum":["draft","active","archived"]},"coverHtml":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","kind","status","coverHtml","createdAt","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.list":{"post":{"operationId":"companies.list","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.list.md"},"x-mcp-tool":"companies_list","x-cli":"node cli/atomiks.mjs companies.list --json '{...}'","x-session-only":false,"summary":"Listar empresas","description":"Empresas da conta (20 por página). `q` busca na razão social, no nome fantasia e no CNPJ; filtros `states` (UF), `cities`, `sizeTiers` (`SMB`, `MID`, `ENTERPRISE`) e `sectors`; `sort`: `name_asc` (padrão), `name_desc`, `created_desc`, `employees_desc`, `revenue_desc` (os dois últimos dependem do Econodata e ordenam por nome). Os filtros do Econodata (`cnaes`, `sizes`, `statuses`, `empMin`, `empMax`, `revMin`, `revMax`, `debt`, `enriched`) não têm dado no Atomiks: com qualquer um a lista vem vazia. `metrics` conta a conta inteira, sem os filtros; `enriched` é sempre 0.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"q":{"type":"string","maxLength":255},"sort":{"type":"string","enum":["name_asc","name_desc","created_desc","employees_desc","revenue_desc"]},"states":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":2}},"cities":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":100}},"sizeTiers":{"maxItems":3,"type":"array","items":{"type":"string","enum":["SMB","MID","ENTERPRISE"]}},"sectors":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":100}},"cnaes":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":20}},"sizes":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":40}},"statuses":{"maxItems":30,"type":"array","items":{"type":"string","maxLength":40}},"empMin":{"type":"number","minimum":0},"empMax":{"type":"number","minimum":0},"revMin":{"type":"number","minimum":0},"revMax":{"type":"number","minimum":0},"debt":{"type":"boolean"},"enriched":{"type":"boolean"},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"sort":"name_asc"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"tradeName":{"type":["string","null"]},"taxId":{"type":["string","null"]},"taxIdType":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"addressStreet":{"type":["string","null"]},"addressCity":{"type":["string","null"]},"addressState":{"type":["string","null"]},"addressPostalCode":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"industry":{"type":["string","null"]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"type":"null"}},"required":["id","legalName","tradeName","taxId","taxIdType","email","phone","website","addressStreet","addressCity","addressState","addressPostalCode","countryCode","industry","sizeTier","createdAt","updatedAt","enrichment"],"additionalProperties":false}},"total":{"type":"number"},"metrics":{"type":"object","properties":{"total":{"type":"number"},"smb":{"type":"number"},"mid":{"type":"number"},"enterprise":{"type":"number"},"enriched":{"type":"number"}},"required":["total","smb","mid","enterprise","enriched"],"additionalProperties":false}},"required":["items","total","metrics"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.facets":{"post":{"operationId":"companies.facets","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.facets.md"},"x-mcp-tool":"companies_facets","x-cli":"node cli/atomiks.mjs companies.facets --json '{...}'","x-session-only":false,"summary":"Opções dos filtros de empresas","description":"Valores que a conta já usa em UF, cidade e setor (para os filtros da lista). `cnaes`, `sizeEstimates` e `statuses` vêm do Econodata e saem vazios.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"states":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"string"}},"sectors":{"type":"array","items":{"type":"string"}},"cnaes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":["string","null"]}},"required":["code","description"],"additionalProperties":false}},"sizeEstimates":{"type":"array","items":{"type":"string"}},"statuses":{"type":"array","items":{"type":"string"}}},"required":["states","cities","sectors","cnaes","sizeEstimates","statuses"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.get":{"post":{"operationId":"companies.get","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.get.md"},"x-mcp-tool":"companies_get","x-cli":"node cli/atomiks.mjs companies.get --json '{...}'","x-session-only":false,"summary":"Ver uma empresa","description":"Cadastro da empresa. `enrichment` é sempre nulo (sem Econodata).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"tradeName":{"type":["string","null"]},"taxId":{"type":["string","null"]},"taxIdType":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"addressStreet":{"type":["string","null"]},"addressCity":{"type":["string","null"]},"addressState":{"type":["string","null"]},"addressPostalCode":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"industry":{"type":["string","null"]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"type":"null"}},"required":["id","legalName","tradeName","taxId","taxIdType","email","phone","website","addressStreet","addressCity","addressState","addressPostalCode","countryCode","industry","sizeTier","createdAt","updatedAt","enrichment"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.create":{"post":{"operationId":"companies.create","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.create.md"},"x-mcp-tool":"companies_create","x-cli":"node cli/atomiks.mjs companies.create --json '{...}'","x-session-only":false,"summary":"Criar empresa","description":"Cria a empresa com a razão social (`legalName`, única na conta sem diferenciar maiúsculas) e, se quiser, o resto do cadastro. `taxId` é o CNPJ; `sizeTier` é `SMB`, `MID` ou `ENTERPRISE`. Sem a atualização do banco só a razão social é aceita (`migration_pendente` nos demais campos).","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"legalName":{"type":"string","minLength":1,"maxLength":120},"tradeName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"taxIdType":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"addressState":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}]},"addressPostalCode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]}},"required":["legalName"]},"example":{"legalName":"Acme Comércio Ltda","tradeName":"Acme","taxId":"12.345.678/0001-90","taxIdType":"CNPJ","sizeTier":"SMB"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"tradeName":{"type":["string","null"]},"taxId":{"type":["string","null"]},"taxIdType":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"addressStreet":{"type":["string","null"]},"addressCity":{"type":["string","null"]},"addressState":{"type":["string","null"]},"addressPostalCode":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"industry":{"type":["string","null"]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"type":"null"}},"required":["id","legalName","tradeName","taxId","taxIdType","email","phone","website","addressStreet","addressCity","addressState","addressPostalCode","countryCode","industry","sizeTier","createdAt","updatedAt","enrichment"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.update":{"post":{"operationId":"companies.update","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.update.md"},"x-mcp-tool":"companies_update","x-cli":"node cli/atomiks.mjs companies.update --json '{...}'","x-session-only":false,"summary":"Editar empresa","description":"Muda só o que vier; `null` (ou texto vazio) limpa um campo opcional. A razão social não pode ficar vazia.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"legalName":{"type":"string","minLength":1,"maxLength":120},"tradeName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"taxIdType":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"addressState":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}]},"addressPostalCode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}]},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","phone":"(11) 3456-7800"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"legalName":{"type":"string"},"tradeName":{"type":["string","null"]},"taxId":{"type":["string","null"]},"taxIdType":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"addressStreet":{"type":["string","null"]},"addressCity":{"type":["string","null"]},"addressState":{"type":["string","null"]},"addressPostalCode":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"industry":{"type":["string","null"]},"sizeTier":{"anyOf":[{"type":"string","enum":["SMB","MID","ENTERPRISE"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"type":"null"}},"required":["id","legalName","tradeName","taxId","taxIdType","email","phone","website","addressStreet","addressCity","addressState","addressPostalCode","countryCode","industry","sizeTier","createdAt","updatedAt","enrichment"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.delete":{"post":{"operationId":"companies.delete","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.delete.md"},"x-mcp-tool":"companies_delete","x-cli":"node cli/atomiks.mjs companies.delete --json '{...}'","x-session-only":false,"summary":"Excluir empresa","description":"Remove a empresa e desfaz o vínculo com contatos e oportunidades (as oportunidades ficam sem empresa) e as ligações dos Objetos personalizados. Não dá para desfazer.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.contacts":{"post":{"operationId":"companies.contacts","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.contacts.md"},"x-mcp-tool":"companies_contacts","x-cli":"node cli/atomiks.mjs companies.contacts --json '{...}'","x-session-only":false,"summary":"Contatos de uma empresa","description":"Contatos vinculados à empresa que o membro pode ver, do vínculo mais recente ao mais antigo. Sem a atualização do banco vem vazio. `temperatureStatus` sai nulo.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"temperatureStatus":{"type":["string","null"]}},"required":["id","name","email","phone","temperatureStatus"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.contact_link":{"post":{"operationId":"companies.contact_link","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.contact_link.md"},"x-mcp-tool":"companies_contact_link","x-cli":"node cli/atomiks.mjs companies.contact_link --json '{...}'","x-session-only":false,"summary":"Vincular contato à empresa","description":"`id` é a empresa. O contato precisa estar visível ao membro. Vincular de novo não faz nada.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","contactId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"}},"required":["id","contactId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.contact_unlink":{"post":{"operationId":"companies.contact_unlink","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.contact_unlink.md"},"x-mcp-tool":"companies_contact_unlink","x-cli":"node cli/atomiks.mjs companies.contact_unlink --json '{...}'","x-session-only":false,"summary":"Desvincular contato da empresa","description":"`id` é a empresa. O contato continua existindo.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","contactId"]},"example":{"id":"00000000-0000-0000-0000-000000000000","contactId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"}},"required":["id","contactId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/companies.audit_list":{"post":{"operationId":"companies.audit_list","tags":["companies"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/companies.audit_list.md"},"x-mcp-tool":"companies_audit_list","x-cli":"node cli/atomiks.mjs companies.audit_list --json '{...}'","x-session-only":false,"summary":"Auditoria de uma empresa","description":"Só administradores. Alterações registradas na atividade da conta que citam a empresa, da mais recente para a mais antiga. Paginação: `before` = `nextBefore` (id da linha).","x-scope":"activity:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"before":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"at":{"type":"string"},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"action":{"type":"string"},"summary":{"type":"string"}},"required":["id","at","actor","action","summary"],"additionalProperties":false}},"nextBefore":{"type":["number","null"]}},"required":["items","nextBefore"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.summary":{"post":{"operationId":"visitors.summary","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.summary.md"},"x-mcp-tool":"visitors_summary","x-cli":"node cli/atomiks.mjs visitors.summary --json '{...}'","x-session-only":false,"summary":"Totais de visitantes","description":"Totais dos cartões de Visitantes: visitantes, novos visitantes, sessões e contatos gerados. O Atomiks ainda não rastreia visitas às páginas, então devolve zeros.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120},"projectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeProjectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"pageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludePageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"funnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeFunnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"channels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"excludeChannels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"hasLead":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totalVisitors":{"type":"number"},"newVisitors":{"type":"number"},"totalSessions":{"type":"number"},"leadsGenerated":{"type":"number"}},"required":["totalVisitors","newVisitors","totalSessions","leadsGenerated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.list":{"post":{"operationId":"visitors.list","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.list.md"},"x-mcp-tool":"visitors_list","x-cli":"node cli/atomiks.mjs visitors.list --json '{...}'","x-session-only":false,"summary":"Lista de visitantes","description":"Visitantes das páginas, do mais recente ao mais antigo, com `search` (ID do visitante ou IP), os filtros de projeto, página, funil, canal e contato (`hasLead`) e paginação (`page`, `perPage` até 100). Cada linha traz canal da primeira visita, sessões, última página e funil, dispositivo e o contato vinculado. Sem rastreio no Atomiks, a lista é vazia: `{data: [], meta: {countPages: 0, countItens: 0}}`.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120},"projectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeProjectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"pageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludePageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"funnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeFunnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"channels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"excludeChannels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"hasLead":{"type":"boolean"},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"sessionCount":{"type":"number"},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"device":{"type":"object","properties":{"type":{"type":"string","enum":["desktop","mobile","tablet","unknown"]},"os":{"type":["string","null"]},"browser":{"type":["string","null"]}},"required":["type"],"additionalProperties":false},"projectId":{"type":["string","null"]},"lastPage":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"imageUrl":{"type":["string","null"]}},"required":["id","name","imageUrl"],"additionalProperties":false},{"type":"null"}]},"lastFunnel":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":["string","null"]},"projectSlug":{"type":["string","null"]},"path":{"type":["string","null"]}},"required":["id","name","version","projectSlug","path"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"linkedAt":{"type":"string"}},"required":["id","name","email","linkedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","channel","sessionCount","firstSeenAt","lastSeenAt","device","projectId","lastPage","lastFunnel","lead"],"additionalProperties":false}},"meta":{"type":"object","properties":{"countPages":{"type":"number"},"countItens":{"type":"number"}},"required":["countPages","countItens"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.get":{"post":{"operationId":"visitors.get","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.get.md"},"x-mcp-tool":"visitors_get","x-cli":"node cli/atomiks.mjs visitors.get --json '{...}'","x-session-only":false,"summary":"Detalhe do visitante","description":"Um visitante com as sessões (e as ações de cada uma), o primeiro toque (origem e UTMs), o último IP e o contato vinculado. `not_found` quando o visitante não existe; sem rastreio no Atomiks, nenhum existe.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80}},"required":["id"]},"example":{"id":"vis_00000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"device":{"type":"object","properties":{"type":{"type":"string","enum":["desktop","mobile","tablet","unknown"]},"os":{"type":["string","null"]},"browser":{"type":["string","null"]}},"required":["type"],"additionalProperties":false},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"},"sessionCount":{"type":"number"},"lastIpAddress":{"type":["string","null"]},"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"startedAt":{"type":"string"},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"utmCampaign":{"type":["string","null"]},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"referrer":{"type":["string","null"]},"landingUrl":{"type":["string","null"]},"landingHostname":{"type":["string","null"]},"landingPathname":{"type":["string","null"]},"projectName":{"type":["string","null"]},"clickIds":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok","microsoft"]},"param":{"type":"string"},"value":{"type":"string"}},"required":["platform","param","value"],"additionalProperties":false}},"durationSeconds":{"type":"number"},"engagementSeconds":{"type":"number"},"maxScrollPercent":{"type":["number","null"]},"eventCount":{"type":"number"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"occurredAt":{"type":"string"},"pageName":{"type":["string","null"]},"formName":{"type":["string","null"]},"pathname":{"type":["string","null"]},"formStepId":{"type":["string","null"]}},"required":["id","eventType","occurredAt","pageName","formName","pathname","formStepId"],"additionalProperties":false}},"hasMoreEvents":{"type":"boolean"}},"required":["id","startedAt","channel","utmCampaign","utmSource","utmMedium","referrer","landingUrl","landingHostname","landingPathname","projectName","clickIds","durationSeconds","engagementSeconds","maxScrollPercent","eventCount","events","hasMoreEvents"],"additionalProperties":false}},"hasMoreSessions":{"type":"boolean"},"firstTouch":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"startedAt":{"type":"string"},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"utmCampaign":{"type":["string","null"]},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"referrer":{"type":["string","null"]},"landingUrl":{"type":["string","null"]},"landingHostname":{"type":["string","null"]},"landingPathname":{"type":["string","null"]},"projectName":{"type":["string","null"]},"clickIds":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok","microsoft"]},"param":{"type":"string"},"value":{"type":"string"}},"required":["platform","param","value"],"additionalProperties":false}},"durationSeconds":{"type":"number"},"engagementSeconds":{"type":"number"},"maxScrollPercent":{"type":["number","null"]},"eventCount":{"type":"number"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"occurredAt":{"type":"string"},"pageName":{"type":["string","null"]},"formName":{"type":["string","null"]},"pathname":{"type":["string","null"]},"formStepId":{"type":["string","null"]}},"required":["id","eventType","occurredAt","pageName","formName","pathname","formStepId"],"additionalProperties":false}},"hasMoreEvents":{"type":"boolean"}},"required":["id","startedAt","channel","utmCampaign","utmSource","utmMedium","referrer","landingUrl","landingHostname","landingPathname","projectName","clickIds","durationSeconds","engagementSeconds","maxScrollPercent","eventCount","events","hasMoreEvents"],"additionalProperties":false},{"type":"null"}]},"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"linkedAt":{"type":"string"}},"required":["id","name","email","linkedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","channel","device","firstSeenAt","lastSeenAt","sessionCount","lastIpAddress","sessions","hasMoreSessions","firstTouch","lead"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.analytics":{"post":{"operationId":"visitors.analytics","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.analytics.md"},"x-mcp-tool":"visitors_analytics","x-cli":"node cli/atomiks.mjs visitors.analytics --json '{...}'","x-session-only":false,"summary":"Analytics de visitantes","description":"Analytics do período (`startDate`..`endDate`, opcional `projectId` e `timeZone`): resumo (14 indicadores), tráfego por dia, sessões e conversão por canal, campanhas por canal, UTMs, sites que indicaram, páginas de entrada, projetos, páginas, funis e formulários mais vistos, ações, dispositivos, navegadores, sistemas, origem geográfica e visitas por hora e dia da semana. Sem rastreio no Atomiks, tudo em zero.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"projectId":{"type":"string","maxLength":80},"timeZone":{"type":"string","maxLength":64}},"required":["startDate","endDate"]},"example":{"startDate":"2026-10-01T00:00:00-03:00","endDate":"2026-10-31T23:59:59-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"summary":{"type":"object","properties":{"totalVisitors":{"type":"number"},"newVisitors":{"type":"number"},"returningVisitors":{"type":"number"},"totalSessions":{"type":"number"},"leadsGenerated":{"type":"number"},"conversionRate":{"type":"number"},"pageViews":{"type":"number"},"formSubmissions":{"type":"number"},"totalEvents":{"type":"number"},"sessionsPerVisitor":{"type":"number"},"avgSessionDurationSeconds":{"type":"number"},"avgEngagementSeconds":{"type":"number"},"bounceRate":{"type":"number"},"avgScrollPercent":{"type":["number","null"]}},"required":["totalVisitors","newVisitors","returningVisitors","totalSessions","leadsGenerated","conversionRate","pageViews","formSubmissions","totalEvents","sessionsPerVisitor","avgSessionDurationSeconds","avgEngagementSeconds","bounceRate","avgScrollPercent"],"additionalProperties":false},"timeseries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"visitors":{"type":"number"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["date","visitors","sessions","leads"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"sessions":{"type":"number"},"leads":{"type":"number"},"conversionRate":{"type":"number"}},"required":["channel","sessions","leads","conversionRate"],"additionalProperties":false}},"geo":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","properties":{"visitors":{"type":"number"},"leads":{"type":"number"},"buyers":{"type":"number"},"country":{"type":"string"}},"required":["visitors","leads","buyers","country"],"additionalProperties":false}},"unknownCountry":{"type":"object","properties":{"visitors":{"type":"number"},"leads":{"type":"number"},"buyers":{"type":"number"}},"required":["visitors","leads","buyers"],"additionalProperties":false}},"required":["countries","unknownCountry"],"additionalProperties":false},"campaigns":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"campaign":{"type":["string","null"]},"sessions":{"type":"number"},"leads":{"type":"number"},"conversionRate":{"type":"number"}},"required":["channel","campaign","sessions","leads","conversionRate"],"additionalProperties":false}},"hasMoreCampaigns":{"type":"boolean"},"utmSources":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"utmMediums":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"utmCampaigns":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"referrers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"landingPages":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"projects":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"sessions":{"type":"number"},"leads":{"type":"number"}},"required":["label","sessions","leads"],"additionalProperties":false}},"topPages":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"number"},"visitors":{"type":"number"}},"required":["name","events","visitors"],"additionalProperties":false}},"topFunnels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"number"},"visitors":{"type":"number"}},"required":["name","events","visitors"],"additionalProperties":false}},"topForms":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"number"},"visitors":{"type":"number"}},"required":["name","events","visitors"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"count":{"type":"number"},"visitors":{"type":"number"}},"required":["eventType","count","visitors"],"additionalProperties":false}},"devices":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["desktop","mobile","tablet","unknown"]},"visitors":{"type":"number"}},"required":["type","visitors"],"additionalProperties":false}},"browsers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"visitors":{"type":"number"}},"required":["label","visitors"],"additionalProperties":false}},"operatingSystems":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"visitors":{"type":"number"}},"required":["label","visitors"],"additionalProperties":false}},"hourOfDay":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"sessions":{"type":"number"}},"required":["hour","sessions"],"additionalProperties":false}},"dayOfWeek":{"type":"array","items":{"type":"object","properties":{"day":{"type":"number"},"sessions":{"type":"number"}},"required":["day","sessions"],"additionalProperties":false}}},"required":["summary","timeseries","channels","geo","campaigns","hasMoreCampaigns","utmSources","utmMediums","utmCampaigns","referrers","landingPages","projects","topPages","topFunnels","topForms","events","devices","browsers","operatingSystems","hourOfDay","dayOfWeek"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.funnel":{"post":{"operationId":"visitors.funnel","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.funnel.md"},"x-mcp-tool":"visitors_funnel","x-cli":"node cli/atomiks.mjs visitors.funnel --json '{...}'","x-session-only":false,"summary":"Funil de conversão dos visitantes","description":"Quantos visitantes chegaram a cada etapa (página vista, formulário, checkout, compra) no período, com a taxa sobre a etapa anterior e sobre o topo. `channel` restringe a um canal. Sem rastreio no Atomiks, sem etapas.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"startDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endDate":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"projectId":{"type":"string","maxLength":80},"timeZone":{"type":"string","maxLength":64},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"required":["startDate","endDate"]},"example":{"startDate":"2026-10-01T00:00:00-03:00","endDate":"2026-10-31T23:59:59-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"eventType":{"type":"string"},"visitors":{"type":"number"},"fromPrevious":{"type":"number"},"fromTop":{"type":"number"}},"required":["eventType","visitors","fromPrevious","fromTop"],"additionalProperties":false}}},"required":["stages"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.live":{"post":{"operationId":"visitors.live","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.live.md"},"x-mcp-tool":"visitors_live","x-cli":"node cli/atomiks.mjs visitors.live --json '{...}'","x-session-only":false,"summary":"Ações ao vivo","description":"Ações dos visitantes nas últimas 24 horas (até 100, mais recentes primeiro) e a contagem da última hora (`lastHourCountCapped` quando passa do teto). Sem rastreio no Atomiks, vazio.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"visitorId":{"type":"string"},"eventType":{"type":"string"},"occurredAt":{"type":"string"},"channel":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]},"leadName":{"type":["string","null"]},"pageName":{"type":["string","null"]},"hostname":{"type":["string","null"]},"pathname":{"type":["string","null"]}},"required":["id","visitorId","eventType","occurredAt","channel","leadName","pageName","hostname","pathname"],"additionalProperties":false}},"lastHourCount":{"type":"number"},"lastHourCountCapped":{"type":"boolean"}},"required":["events","lastHourCount","lastHourCountCapped"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.filter_options":{"post":{"operationId":"visitors.filter_options","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.filter_options.md"},"x-mcp-tool":"visitors_filter_options","x-cli":"node cli/atomiks.mjs visitors.filter_options --json '{...}'","x-session-only":false,"summary":"Opções dos filtros de visitantes","description":"Valores que os filtros Projeto, Página e Funil aceitam (`kind`), com busca por nome. O Atomiks não tem páginas, funis nem projetos próprios, então a lista é vazia.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["project","page","funnel"]},"search":{"type":"string","maxLength":120}},"required":["kind"]},"example":{"kind":"page"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/visitors.export":{"post":{"operationId":"visitors.export","tags":["visitors"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/visitors.export.md"},"x-mcp-tool":"visitors_export","x-cli":"node cli/atomiks.mjs visitors.export --json '{...}'","x-session-only":false,"summary":"Exportar visitantes em CSV","description":"CSV com um visitante por linha dos que batem com a busca e os filtros (mesmos de `visitors.list`): ID, acessos, sessões, canal, dispositivo, última página e funil, e o contato vinculado. Devolve `filename`, `csv` (texto) e `count`. Sem rastreio no Atomiks, só o cabeçalho.","x-scope":"contacts:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120},"projectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeProjectIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"pageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludePageIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"funnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"excludeFunnelIds":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"channels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"excludeChannels":{"maxItems":20,"type":"array","items":{"type":"string","enum":["google","facebook","instagram","tiktok","youtube","linkedin","whatsapp","email","referral","direct","other"]}},"hasLead":{"type":"boolean"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/external_recovery.overview":{"post":{"operationId":"external_recovery.overview","tags":["external_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/external_recovery.overview.md"},"x-mcp-tool":"external_recovery_overview","x-cli":"node cli/atomiks.mjs external_recovery.overview --json '{...}'","x-session-only":false,"summary":"Cartões da recuperação de vendas externas","description":"Quantidade e valor (na moeda `currency`, ou a mais frequente) dos pedidos de plataformas externas recusados, com chargeback, reembolsados e cancelados, e a quantidade de carrinhos abandonados. `currency` vem nulo sem pedidos.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currency":{"type":"string","maxLength":3}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currency":{"type":["string","null"]},"salesByCurrency":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"}},"required":["currency"],"additionalProperties":false}},"statusBreakdown":{"type":"object","properties":{"failed":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"chargeback":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"refunded":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"canceled":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false}},"required":["failed","chargeback","refunded","canceled"],"additionalProperties":false},"cartAbandonment":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}},"required":["currency","salesByCurrency","statusBreakdown","cartAbandonment"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/external_recovery.list":{"post":{"operationId":"external_recovery.list","tags":["external_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/external_recovery.list.md"},"x-mcp-tool":"external_recovery_list","x-cli":"node cli/atomiks.mjs external_recovery.list --json '{...}'","x-session-only":false,"summary":"Listar pedidos externos para recuperar","description":"Pedidos de plataformas externas da sub-aba (`failed`: recusados; `chargeback`; `refunded`; `canceled`), mais novos primeiro, com comprador, produto, código da oferta, valor, plataforma e método. `searchText` busca em nome, e-mail, produto, oferta e código.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subTab":{"type":"string","enum":["failed","chargeback","refunded","canceled"]},"searchText":{"type":"string","maxLength":200},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["subTab"]},"example":{"subTab":"failed","page":1,"perPage":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["failed","chargeback","refunded","canceled"]},"createdAt":{"type":"string"},"lead":{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"],"additionalProperties":false},"shortenId":{"type":"string"},"productName":{"type":["string","null"]},"offerCode":{"type":["string","null"]},"value":{"type":"number"},"currency":{"type":"string"},"gatewayOrigin":{"type":["string","null"]},"method":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]}},"required":["id","status","createdAt","lead","shortenId","productName","offerCode","value","currency","gatewayOrigin","method"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/external_recovery.abandonment_list":{"post":{"operationId":"external_recovery.abandonment_list","tags":["external_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/external_recovery.abandonment_list.md"},"x-mcp-tool":"external_recovery_abandonment_list","x-cli":"node cli/atomiks.mjs external_recovery.abandonment_list --json '{...}'","x-session-only":false,"summary":"Listar carrinhos abandonados das plataformas externas","description":"Carrinhos abandonados avisados pelas plataformas (`cart.abandoned.v1`), mais novos primeiro, com contato, produto, oferta, valor (0 quando a plataforma não manda) e plataforma. `searchText` busca em contato, e-mail, produto e oferta.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"searchText":{"type":"string","maxLength":200},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"productName":{"type":["string","null"]},"offerName":{"type":["string","null"]},"offerValue":{"type":"number"},"currency":{"type":["string","null"]},"platform":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","leadId","leadName","productName","offerName","offerValue","currency","platform","createdAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/external_recovery.export_csv":{"post":{"operationId":"external_recovery.export_csv","tags":["external_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/external_recovery.export_csv.md"},"x-mcp-tool":"external_recovery_export_csv","x-cli":"node cli/atomiks.mjs external_recovery.export_csv --json '{...}'","x-session-only":false,"summary":"Exportar a recuperação externa em CSV","description":"Texto CSV (separador \";\") da sub-aba da recuperação externa. A tela baixa como `external-recovery-<sub-aba>.csv`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subTab":{"type":"string","enum":["failed","chargeback","refunded","canceled","cartAbandonment"]}},"required":["subTab"]},"example":{"subTab":"failed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/external_recovery.create_list":{"post":{"operationId":"external_recovery.create_list","tags":["external_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/external_recovery.create_list.md"},"x-mcp-tool":"external_recovery_create_list","x-cli":"node cli/atomiks.mjs external_recovery.create_list --json '{...}'","x-session-only":false,"summary":"Criar lista de contatos para recuperação","description":"Cria a lista manual `name` (se já existe uma com esse nome, usa a existente) e põe nela os contatos dos itens dos status escolhidos (`statuses`). Itens sem contato vinculado ficam de fora e são contados em `withoutContact`.","x-scope":"crm:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"statuses":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","enum":["failed","chargeback","refunded","canceled","cartAbandonment"]}}},"required":["name","statuses"]},"example":{"name":"Recuperação externa","statuses":["failed","cartAbandonment"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"added":{"type":"number"},"withoutContact":{"type":"number"}},"required":["id","name","added","withoutContact"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.list":{"post":{"operationId":"subscriptions.list","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.list.md"},"x-mcp-tool":"subscriptions_list","x-cli":"node cli/atomiks.mjs subscriptions.list --json '{...}'","x-session-only":false,"summary":"Listar assinaturas","description":"Assinaturas das plataformas integradas (Hotmart, Kiwify...), uma por código de assinatura, com assinante, plano, valor, periodicidade, última e próxima cobrança. `status`: `active_paid` ou `canceled` (trial e encerrada não têm fonte). Ordenação por `column` (activationDate, offerName, frequency, price, buyerName ou status) e `order`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"subscriptionStartedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"membershipPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"subscriptionCreatedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"contactStatus":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"subscriptionStatus":{"maxItems":5,"type":"array","items":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"subscriptionPlan":{"maxItems":4,"type":"array","items":{"type":"string","enum":["1","3","6","12"]}}}},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100},"column":{"type":"string","enum":["activationDate","offerName","frequency","price","buyerName","status"]},"order":{"type":"string","enum":["asc","desc"]}}},"example":{"page":1,"perPage":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]},"subscriber":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"leadId":{"type":["string","null"]},"plan":{"type":"string"},"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly","bimonthly","quarterly","semiannual","yearly"]},"price":{"type":"number"},"discountAmount":{"type":"number"},"commission":{"type":"number"},"activationDate":{"type":"string"},"lastPurchase":{"type":["string","null"]},"nextBillingAt":{"type":["string","null"]},"expiresTrialAt":{"type":["string","null"]},"purchaseCount":{"type":"number"},"chargeLimit":{"anyOf":[{"type":"object","properties":{"paidCharges":{"type":"number"},"maxCharges":{"type":"number"}},"required":["paidCharges","maxCharges"],"additionalProperties":false},{"type":"null"}]},"gateway":{"type":"string"},"paymentMethod":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"isPixRecurring":{"type":"boolean"},"currency":{"type":"string"}},"required":["id","code","status","subscriber","leadId","plan","frequency","price","discountAmount","commission","activationDate","lastPurchase","nextBillingAt","expiresTrialAt","purchaseCount","chargeLimit","gateway","paymentMethod","isPixRecurring","currency"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.overview":{"post":{"operationId":"subscriptions.overview","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.overview.md"},"x-mcp-tool":"subscriptions_overview","x-cli":"node cli/atomiks.mjs subscriptions.overview --json '{...}'","x-session-only":false,"summary":"Cartões das assinaturas","description":"Receita das assinaturas (compras aprovadas), assinantes únicos, ticket médio por assinante, ativas, receita recorrente mensal, total, trial (sempre 0: sem fonte), cancelamentos, taxa de churn (cancelamentos sobre o total, em %) e inadimplentes (assinatura com cobrança atrasada) com os valores.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"subscriptionStartedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"membershipPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"subscriptionCreatedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"contactStatus":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"subscriptionStatus":{"maxItems":5,"type":"array","items":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"subscriptionPlan":{"maxItems":4,"type":"array","items":{"type":"string","enum":["1","3","6","12"]}}}}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"totalValueSubscriptions":{"type":"number"},"totalNetValueSubscriptions":{"type":"number"},"totalUniqueSubscribers":{"type":"number"},"averageTicketPerSubscriber":{"type":"number"},"totalActiveSubscriptions":{"type":"number"},"monthlyRecurringRevenue":{"type":"number"},"totalSubscriptions":{"type":"number"},"totalTrialSubscriptions":{"type":"number"},"trialPercentage":{"type":"number"},"totalPotentialRevenue":{"type":"number"},"totalCancelledSubscriptions":{"type":"number"},"churnRate":{"type":"number"},"totalValueCancelledSubscriptions":{"type":"number"},"totalDefaulterSubscriptions":{"type":"number"},"totalDefaulterValue":{"type":"number"}},"required":["totalValueSubscriptions","totalNetValueSubscriptions","totalUniqueSubscribers","averageTicketPerSubscriber","totalActiveSubscriptions","monthlyRecurringRevenue","totalSubscriptions","totalTrialSubscriptions","trialPercentage","totalPotentialRevenue","totalCancelledSubscriptions","churnRate","totalValueCancelledSubscriptions","totalDefaulterSubscriptions","totalDefaulterValue"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.chart":{"post":{"operationId":"subscriptions.chart","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.chart.md"},"x-mcp-tool":"subscriptions_chart","x-cli":"node cli/atomiks.mjs subscriptions.chart --json '{...}'","x-session-only":false,"summary":"Gráfico das assinaturas","description":"Receita (centavos) e número de compras aprovadas das assinaturas por dia, semana ISO ou mês (`period`), no fuso da conta, entre `from` e `to`. Só vêm os períodos com compra; o período de ativação dos filtros não vale aqui.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","enum":["daily","weekly","monthly"]},"filters":{"type":"object","properties":{"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"subscriptionStartedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"membershipPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"subscriptionCreatedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"contactStatus":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"subscriptionStatus":{"maxItems":5,"type":"array","items":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"subscriptionPlan":{"maxItems":4,"type":"array","items":{"type":"string","enum":["1","3","6","12"]}}}}},"required":["from","to","period"]},"example":{"from":"2026-10-01T00:00:00.000Z","to":"2026-10-26T23:59:59.999Z","period":"daily"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revenueData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"revenue":{"type":"number"}},"required":["period","label","revenue"],"additionalProperties":false}},"purchasesData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"purchases":{"type":"number"}},"required":["period","label","purchases"],"additionalProperties":false}}},"required":["revenueData","purchasesData"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.get":{"post":{"operationId":"subscriptions.get","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.get.md"},"x-mcp-tool":"subscriptions_get","x-cli":"node cli/atomiks.mjs subscriptions.get --json '{...}'","x-session-only":false,"summary":"Detalhe da assinatura","description":"Assinatura (`id` = `plataforma:código`): situação, plano, valor, periodicidade, compras (a venda original e as faturas), LTV e os dados do assinante. `not_found` se não existir.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":300}},"required":["id"]},"example":{"id":"hotmart:00000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subscription":{"type":"object","properties":{"id":{"type":"string"},"shortenCode":{"type":"string"},"status":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]},"plan":{"type":"string"},"activationDate":{"type":"string"},"price":{"type":"number"},"dueDay":{"type":["string","null"]},"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly","bimonthly","quarterly","semiannual","yearly"]},"lastPurchase":{"type":["string","null"]},"purchasesCount":{"type":"number"},"nextPurchase":{"type":["string","null"]},"ltv":{"type":"number"},"cancelledAt":{"type":["string","null"]},"chargeLimit":{"anyOf":[{"type":"object","properties":{"remainingCharges":{"type":"number"},"maxCharges":{"type":"number"},"expectedEndAt":{"type":["string","null"]}},"required":["remainingCharges","maxCharges","expectedEndAt"],"additionalProperties":false},{"type":"null"}]},"endedAt":{"type":["string","null"]},"isPixRecurring":{"type":"boolean"}},"required":["id","shortenCode","status","plan","activationDate","price","dueDay","frequency","lastPurchase","purchasesCount","nextPurchase","ltv","cancelledAt","chargeLimit","endedAt","isPixRecurring"],"additionalProperties":false},"buyer":{"type":"object","properties":{"leadId":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"anyOf":[{"type":"object","properties":{"countryCode":{"type":["string","null"]},"areaCode":{"type":["string","null"]},"number":{"type":["string","null"]}},"required":["countryCode","areaCode","number"],"additionalProperties":false},{"type":"null"}]},"document":{"type":["string","null"]},"birthDate":{"type":["string","null"]}},"required":["leadId","name","email","telephone","document","birthDate"],"additionalProperties":false},"purchases":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"shortenCode":{"type":"string"},"kind":{"type":"string","enum":["sale","invoice"]},"invoiceNumber":{"type":["number","null"]},"offer":{"type":"string"},"createdAt":{"type":"string"},"value":{"type":"number"},"commission":{"type":"number"},"method":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"status":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"required":["code","shortenCode","kind","invoiceNumber","offer","createdAt","value","commission","method","status"],"additionalProperties":false}}},"required":["subscription","buyer","purchases"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.cohort":{"post":{"operationId":"subscriptions.cohort","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.cohort.md"},"x-mcp-tool":"subscriptions_cohort","x-cli":"node cli/atomiks.mjs subscriptions.cohort --json '{...}'","x-session-only":false,"summary":"Coortes de assinaturas","description":"Quanto de cada safra (semana ou mês de ativação) segue assinando ao longo do tempo: `retentionPercentage` de 0 a 1 por coluna (a coluna 0 é a safra; vem `null` onde a safra ainda não chegou). Filtra por entrada na base, UTMs, produto, oferta e método de pagamento; `funnelIds` com valor deixa a matriz vazia (sem fonte).","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bucket":{"type":"string","enum":["week","month"]},"enteredFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"enteredTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"utmSources":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMediums":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaigns":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerms":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"paymentMethods":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}}}},"example":{"bucket":"week"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"columns":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"size":{"type":"number"},"retentionPercentage":{"type":"array","items":{"type":["number","null"]}}},"required":["period","size","retentionPercentage"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.filter_options":{"post":{"operationId":"subscriptions.filter_options","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.filter_options.md"},"x-mcp-tool":"subscriptions_filter_options","x-cli":"node cli/atomiks.mjs subscriptions.filter_options --json '{...}'","x-session-only":false,"summary":"Opções dos filtros de assinaturas","description":"UTMs (source, medium, campaign, term), produtos e ofertas vistos nas assinaturas, para os filtros da aba Coortes.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"utmSource":{"type":"array","items":{"type":"string"}},"utmMedium":{"type":"array","items":{"type":"string"}},"utmCampaign":{"type":"array","items":{"type":"string"}},"utmTerm":{"type":"array","items":{"type":"string"}},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["utmSource","utmMedium","utmCampaign","utmTerm","products","offers"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/subscriptions.export_csv":{"post":{"operationId":"subscriptions.export_csv","tags":["subscriptions"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/subscriptions.export_csv.md"},"x-mcp-tool":"subscriptions_export_csv","x-cli":"node cli/atomiks.mjs subscriptions.export_csv --json '{...}'","x-session-only":false,"summary":"Exportar assinaturas em CSV","description":"Texto CSV (separador \";\") das assinaturas com os filtros da tela, na ordem de `column`/`order`. A tela baixa como `subscriptions.csv`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"subscriptionStartedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"membershipPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"subscriptionCreatedPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","maxLength":8}}},"contactStatus":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"subscriptionStatus":{"maxItems":5,"type":"array","items":{"type":"string","enum":["active_trial","active_paid","active_trial_expired","canceled","ended"]}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"subscriptionPlan":{"maxItems":4,"type":"array","items":{"type":"string","enum":["1","3","6","12"]}}}},"column":{"type":"string","enum":["activationDate","offerName","frequency","price","buyerName","status"]},"order":{"type":"string","enum":["asc","desc"]}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales_recovery.overview":{"post":{"operationId":"sales_recovery.overview","tags":["sales_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales_recovery.overview.md"},"x-mcp-tool":"sales_recovery_overview","x-cli":"node cli/atomiks.mjs sales_recovery.overview --json '{...}'","x-session-only":false,"summary":"Cartões da recuperação de vendas","description":"Valor total e itens para recuperação (várias tentativas do mesmo comprador na mesma oferta contam uma vez) e, por tipo, a quantidade e o valor: carrinho abandonado, Pix e boleto em aberto, recusados, vendas canceladas e reembolsos. Os motivos (`*ReasonBreakdown`) e a etapa do abandono vêm vazios nas plataformas.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recovery":{"type":"object","properties":{"totalValue":{"type":"number"},"totalItems":{"type":"number"},"cartAbandonment":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"pixPending":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"boletoPending":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"failed":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"canceled":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false},"refunded":{"type":"object","properties":{"count":{"type":"number"},"value":{"type":"number"}},"required":["count","value"],"additionalProperties":false}},"required":["totalValue","totalItems","cartAbandonment","pixPending","boletoPending","failed","canceled","refunded"],"additionalProperties":false},"failedReasonBreakdown":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"],"additionalProperties":false}},"canceledReasonBreakdown":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"],"additionalProperties":false}},"refundedReasonBreakdown":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"],"additionalProperties":false}},"cartAbandonmentStageBreakdown":{"type":"array","items":{"type":"object","properties":{"stage":{"type":"string"},"count":{"type":"number"}},"required":["stage","count"],"additionalProperties":false}}},"required":["recovery","failedReasonBreakdown","canceledReasonBreakdown","refundedReasonBreakdown","cartAbandonmentStageBreakdown"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales_recovery.chart":{"post":{"operationId":"sales_recovery.chart","tags":["sales_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales_recovery.chart.md"},"x-mcp-tool":"sales_recovery_chart","x-cli":"node cli/atomiks.mjs sales_recovery.chart --json '{...}'","x-session-only":false,"summary":"Gráfico das falhas de vendas","description":"Número de transações perdidas (`purchasesData.purchases`) e valor perdido em centavos (`revenueData.revenue`) por dia, semana ISO ou mês, no fuso da conta, entre `from` e `to`. Só vêm os períodos com perda.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"period":{"type":"string","enum":["daily","weekly","monthly"]},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}}},"required":["from","to","period"]},"example":{"from":"2026-10-01T00:00:00.000Z","to":"2026-10-26T23:59:59.999Z","period":"daily"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revenueData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"revenue":{"type":"number"}},"required":["period","label","revenue"],"additionalProperties":false}},"purchasesData":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"label":{"type":"string"},"purchases":{"type":"number"}},"required":["period","label","purchases"],"additionalProperties":false}}},"required":["revenueData","purchasesData"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales_recovery.list":{"post":{"operationId":"sales_recovery.list","tags":["sales_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales_recovery.list.md"},"x-mcp-tool":"sales_recovery_list","x-cli":"node cli/atomiks.mjs sales_recovery.list --json '{...}'","x-session-only":false,"summary":"Listar transações para recuperar","description":"Transações da sub-aba (`failed`: recusadas e chargeback; `canceled`; `pixExpired`: Pix em aberto; `bankSlipExpired`: boleto em aberto; `refunded`), mais novas primeiro, com comprador, produto, oferta, valor e método. `searchText` busca em nome, e-mail, produto, oferta e código.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subTab":{"type":"string","enum":["failed","canceled","pixExpired","bankSlipExpired","refunded"]},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"searchText":{"type":"string","maxLength":200},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100}},"required":["subTab"]},"example":{"subTab":"failed","page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"shortenCode":{"type":"string"},"status":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]},"buyer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"product":{"type":"string"},"offer":{"type":"string"},"createdAt":{"type":"string"},"saleValue":{"type":"number"},"paymentMethod":{"anyOf":[{"type":"string","enum":["credit","pix","boleto"]},{"type":"null"}]},"failReason":{"type":["string","null"]},"cancellationReason":{"type":["string","null"]}},"required":["code","shortenCode","status","buyer","product","offer","createdAt","saleValue","paymentMethod","failReason","cancellationReason"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales_recovery.abandonment_list":{"post":{"operationId":"sales_recovery.abandonment_list","tags":["sales_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales_recovery.abandonment_list.md"},"x-mcp-tool":"sales_recovery_abandonment_list","x-cli":"node cli/atomiks.mjs sales_recovery.abandonment_list --json '{...}'","x-session-only":false,"summary":"Listar carrinhos abandonados","description":"Carrinhos abandonados avisados pelas plataformas (`cart.abandoned.v1`), mais novos primeiro, com lead, produto, oferta, valor (0 quando a plataforma não manda) e data. `recurrent` separa os de oferta recorrente.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recurrent":{"type":"boolean"},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"page":{"type":"integer","minimum":1,"maximum":100000},"perPage":{"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"leadName":{"type":["string","null"]},"product":{"type":["string","null"]},"offer":{"type":["string","null"]},"offerValue":{"type":"number"},"stage":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","leadName","product","offer","offerValue","stage","createdAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/sales_recovery.export_csv":{"post":{"operationId":"sales_recovery.export_csv","tags":["sales_recovery"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/sales_recovery.export_csv.md"},"x-mcp-tool":"sales_recovery_export_csv","x-cli":"node cli/atomiks.mjs sales_recovery.export_csv --json '{...}'","x-session-only":false,"summary":"Exportar a recuperação em CSV","description":"Texto CSV (separador \";\") da sub-aba de recuperação com os filtros da tela. A tela baixa como `recovery-<sub-aba>.csv`.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subTab":{"type":"string","enum":["failed","canceled","pixExpired","bankSlipExpired","refunded","cartAbandonment"]},"recurrent":{"type":"boolean"},"filters":{"type":"object","properties":{"transactionPeriod":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}},"searchText":{"type":"string","maxLength":200},"contactName":{"type":"string","maxLength":200},"contactEmail":{"type":"string","maxLength":200},"contactDocument":{"type":"string","maxLength":200},"transactionShortenId":{"type":"string","maxLength":200},"externalId":{"type":"string","maxLength":200},"contactTags":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmSource":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmMedium":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmCampaign":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmTerm":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"utmContent":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"src":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"sck":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionStatus":{"maxItems":10,"type":"array","items":{"type":"string","enum":["pending","paid","canceled","refunded","chargedBack","failed"]}},"projectIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"funnelIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"productIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"offerIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"orderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"excludeOrderBumpOfferIds":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},"transactionRecurrence":{"type":"string","enum":["OneTime","Recurrent","Trial"]},"saleKind":{"type":"string","enum":["new","invoice"]},"currency":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":3}},"valueOfLastPurchase":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":100000},"max":{"type":"number","minimum":0,"maximum":100000}}},"transactionType":{"maxItems":3,"type":"array","items":{"type":"string","enum":["credit","pix","boleto"]}},"suspectedFraudOnly":{"type":"boolean"},"couponCode":{"type":"string","maxLength":200},"externalPageUrl":{"type":"string","maxLength":200},"gatewayOrigin":{"type":"string","maxLength":200},"productName":{"type":"string","maxLength":200},"offerCode":{"type":"string","maxLength":200},"installments":{"type":"integer","minimum":0,"maximum":100}}},"searchText":{"type":"string","maxLength":200}},"required":["subTab"]},"example":{"subTab":"failed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/broadcasts.list":{"post":{"operationId":"broadcasts.list","tags":["broadcasts"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/broadcasts.list.md"},"x-mcp-tool":"broadcasts_list","x-cli":"node cli/atomiks.mjs broadcasts.list --json '{...}'","x-session-only":false,"summary":"Listar envios em massa de um canal","description":"Lista \"Meus envios de …\" de Mensagens > Broadcasts, do mais recente ao mais antigo. Só `whatsapp` tem envios (os de `contacts.bulk_send`); `email`, `sms` e `voice` ainda não existem e voltam vazios com `available: false` e o `reason`. `name` busca no nome (modelo ou começo do texto) e `status` filtra (`sending`, `sent`, `failed`…). Cada item traz `sent`, `failed` e `skipped` (contatos), `processed` (os três somados) e `total`. Detalhes e falhas de um envio: `contacts.bulk_send_get`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channel":{"default":"whatsapp","type":"string","enum":["whatsapp","email","sms","voice"]},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"perPage":{"default":20,"type":"integer","minimum":1,"maximum":100},"name":{"type":"string","maxLength":100},"status":{"maxItems":7,"type":"array","items":{"type":"string","enum":["draft","scheduled","sending","sent","failed","insufficient_credits","suppressed"]}}}},"example":{"channel":"whatsapp","page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"channelId":{"type":"string"},"templateId":{"type":["string","null"]},"text":{"type":["string","null"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"status":{"type":"string","enum":["draft","scheduled","sending","sent","failed","insufficient_credits","suppressed"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"error":{"type":["string","null"]},"total":{"type":"number"},"processed":{"type":"number"},"sent":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"}},"required":["id","name","channelId","templateId","text","params","status","createdAt","finishedAt","error","total","processed","sent","failed","skipped"],"additionalProperties":false}},"total":{"type":"number"},"available":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["items","total","available","reason"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.list":{"post":{"operationId":"message_history.list","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.list.md"},"x-mcp-tool":"message_history_list","x-cli":"node cli/atomiks.mjs message_history.list --json '{...}'","x-session-only":false,"summary":"Histórico de envio: mensagens enviadas","description":"Aba Mensagens do Histórico de envio: cada mensagem enviada (atendente, automação, disparo em massa ou o celular), da mais recente, com `status` (queued, sent, delivered, visualized, failed; `sending` não existe aqui e filtra para vazio), `messagePlatform` (whatsapp, evolution, instagram), `lead` e `channel` (endereço do destinatário), `messageService` (`workflows`, `broadcast` ou `individual`), `error`. Filtros: `search` (nome, e-mail ou telefone do contato, ou o texto), `status`, `platform`, `broadcastIds` (envios de `broadcasts.list`), `workflowIds` (automações), `from`/`to` e `leadId`. `webhookLogsCount` é sempre 0 e `creditCost` nulo: o Atomiks não guarda os dois por mensagem. Automação vem de `sent_by` nulo; o filtro por automação considera as conversas em que ela rodou.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},"platform":{"type":"string","maxLength":40},"broadcastIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"workflowIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"from":{"type":"string","maxLength":40},"to":{"type":"string","maxLength":40},"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"default":1,"type":"integer","minimum":1,"maximum":10000},"perPage":{"default":20,"type":"integer","minimum":1,"maximum":100}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"queuedAt":{"type":"string"},"messagePlatform":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},"webhookLogsCount":{"type":"number"},"error":{"type":["string","null"]},"leadId":{"type":"string"},"lead":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]}},"required":["name","email","telephone"],"additionalProperties":false},{"type":"null"}]},"channel":{"type":["string","null"]},"messageService":{"type":"string","enum":["workflows","broadcast","individual"]},"creditCost":{"type":["number","null"]},"messageName":{"type":["string","null"]}},"required":["id","queuedAt","messagePlatform","status","webhookLogsCount","error","leadId","lead","channel","messageService","creditCost","messageName"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.export":{"post":{"operationId":"message_history.export","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.export.md"},"x-mcp-tool":"message_history_export","x-cli":"node cli/atomiks.mjs message_history.export --json '{...}'","x-session-only":false,"summary":"Exportar o histórico de envio em CSV","description":"CSV com uma mensagem por linha das que batem com os filtros de `message_history.list` (até 5 000, as mais recentes): ID, data e hora (fuso de São Paulo), canal, status, erro, destinatário, endereço, categoria de envio e custo de créditos. Devolve `filename`, `csv` (texto) e `count`.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"search":{"type":"string","maxLength":120},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},"platform":{"type":"string","maxLength":40},"broadcastIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"workflowIds":{"maxItems":50,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"from":{"type":"string","maxLength":40},"to":{"type":"string","maxLength":40},"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string"},"csv":{"type":"string"},"count":{"type":"number"}},"required":["filename","csv","count"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.options":{"post":{"operationId":"message_history.options","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.options.md"},"x-mcp-tool":"message_history_options","x-cli":"node cli/atomiks.mjs message_history.options --json '{...}'","x-session-only":false,"summary":"Opções dos filtros Broadcast e Automação","description":"Lista para os filtros do Histórico de envio: `kind: broadcast` traz os envios em massa (nome do modelo ou começo do texto), `kind: workflow` as automações, com `id` e `name`. `search` filtra pelo nome. Até 100 itens, os mais recentes.","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["broadcast","workflow"]},"search":{"type":"string","maxLength":100}},"required":["kind"]},"example":{"kind":"workflow"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.detail":{"post":{"operationId":"message_history.detail","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.detail.md"},"x-mcp-tool":"message_history_detail","x-cli":"node cli/atomiks.mjs message_history.detail --json '{...}'","x-session-only":false,"summary":"Detalhe de uma mensagem do histórico de envio","description":"Detalhe da instância: a mensagem (`instance`, com os horários das etapas: fila, enviado, entregue, visualizado, falha; entregue e visualizado valem o horário da própria mensagem, o Atomiks não guarda o de cada etapa) e, na automação, `flow` (a mais recente que rodou na conversa até então); `messages` (outras mensagens enviadas ao mesmo contato, até 12), `webhookLogs` (sempre vazio) e `opportunities` (oportunidades abertas do contato).","x-scope":"messages:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"instance":{"type":"object","properties":{"id":{"type":"string"},"queuedAt":{"type":"string"},"messagePlatform":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},"webhookLogsCount":{"type":"number"},"error":{"type":["string","null"]},"leadId":{"type":"string"},"lead":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]}},"required":["name","email","telephone"],"additionalProperties":false},{"type":"null"}]},"channel":{"type":["string","null"]},"messageService":{"type":"string","enum":["workflows","broadcast","individual"]},"creditCost":{"type":["number","null"]},"messageName":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"visualizedAt":{"type":["string","null"]},"clickedAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]},"flow":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","queuedAt","messagePlatform","status","webhookLogsCount","error","leadId","lead","channel","messageService","creditCost","messageName","sentAt","deliveredAt","visualizedAt","clickedAt","failedAt","flow"],"additionalProperties":false},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"queuedAt":{"type":"string"},"messagePlatform":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},"webhookLogsCount":{"type":"number"},"error":{"type":["string","null"]},"leadId":{"type":"string"},"lead":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"telephone":{"type":["string","null"]}},"required":["name","email","telephone"],"additionalProperties":false},{"type":"null"}]},"channel":{"type":["string","null"]},"messageService":{"type":"string","enum":["workflows","broadcast","individual"]},"creditCost":{"type":["number","null"]},"messageName":{"type":["string","null"]}},"required":["id","queuedAt","messagePlatform","status","webhookLogsCount","error","leadId","lead","channel","messageService","creditCost","messageName"],"additionalProperties":false}},"webhookLogs":{"type":"array","items":{}},"opportunities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"pipelineId":{"type":"string"},"pipelineName":{"type":["string","null"]},"stageName":{"type":["string","null"]}},"required":["id","title","pipelineId","pipelineName","stageName"],"additionalProperties":false}}},"required":["instance","messages","webhookLogs","opportunities"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.webhooks":{"post":{"operationId":"message_history.webhooks","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.webhooks.md"},"x-mcp-tool":"message_history_webhooks","x-cli":"node cli/atomiks.mjs message_history.webhooks --json '{...}'","x-session-only":false,"summary":"Histórico de envio: entregas de webhook","description":"Aba Webhooks do Histórico de envio: as entregas de webhook de saída da conta (`webhook_deliveries`), da mais recente: `provider` (conector da integração), `event`, `httpStatus` da última tentativa, `newStatus` (queued, sending, sent ou failed), `externalMessageId` (id do evento de origem), `processingError` e `receivedAt` (quando entrou na fila). `provider` filtra pelo conector; `search` aceita o id da entrega ou do evento, ou parte do nome do evento. `providers` traz os conectores que a conta usa, para o filtro.","x-scope":"messages:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"default":1,"type":"integer","minimum":1,"maximum":10000},"perPage":{"default":20,"type":"integer","minimum":1,"maximum":100},"provider":{"type":"string","maxLength":40},"search":{"type":"string","maxLength":120}}},"example":{"page":1,"perPage":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"event":{"type":"string"},"httpStatus":{"type":["number","null"]},"newStatus":{"anyOf":[{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},{"type":"null"}]},"externalMessageId":{"type":["string","null"]},"messageInstanceId":{"type":"null"},"processingError":{"type":["string","null"]},"receivedAt":{"type":"string"}},"required":["id","provider","event","httpStatus","newStatus","externalMessageId","messageInstanceId","processingError","receivedAt"],"additionalProperties":false}},"meta":{"type":"object","properties":{"page":{"type":"number"},"perPage":{"type":"number"},"countItens":{"type":"number"},"countPages":{"type":"number"}},"required":["page","perPage","countItens","countPages"],"additionalProperties":false},"providers":{"type":"array","items":{"type":"string"}}},"required":["data","meta","providers"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/message_history.webhook_detail":{"post":{"operationId":"message_history.webhook_detail","tags":["message_history"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/message_history.webhook_detail.md"},"x-mcp-tool":"message_history_webhook_detail","x-cli":"node cli/atomiks.mjs message_history.webhook_detail --json '{...}'","x-session-only":false,"summary":"Detalhe de uma entrega de webhook","description":"Uma entrega de `message_history.webhooks` com o corpo enviado (`payload`, montado do evento de origem; traz dados pessoais do contato), as tentativas e o envio.","x-scope":"messages:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"event":{"type":"string"},"httpStatus":{"type":["number","null"]},"newStatus":{"anyOf":[{"type":"string","enum":["queued","sending","sent","delivered","failed","visualized"]},{"type":"null"}]},"externalMessageId":{"type":["string","null"]},"messageInstanceId":{"type":"null"},"processingError":{"type":["string","null"]},"receivedAt":{"type":"string"},"attempts":{"type":"number"},"sentAt":{"type":["string","null"]},"payload":{}},"required":["id","provider","event","httpStatus","newStatus","externalMessageId","messageInstanceId","processingError","receivedAt","attempts","sentAt","payload"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces.list":{"post":{"operationId":"workspaces.list","tags":["workspaces"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/workspaces.list.md"},"x-mcp-tool":"workspaces_list","x-cli":"node cli/atomiks.mjs workspaces.list --json '{...}'","x-session-only":false,"summary":"Listar os workspaces (contas) do usuário","description":"Contas de que o usuário logado participa, com nome, plano, se ele é o dono (`isOwner`) e a data de criação.","x-scope":null,"x-access":"authenticated","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"planName":{"type":"string"},"isOwner":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","planName","isOwner","createdAt"],"additionalProperties":false}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspaces.rename":{"post":{"operationId":"workspaces.rename","tags":["workspaces"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/workspaces.rename.md"},"x-mcp-tool":"workspaces_rename","x-cli":"node cli/atomiks.mjs workspaces.rename --json '{...}'","x-session-only":false,"summary":"Renomear o workspace atual","description":"Troca o nome da conta atual (1 a 100 caracteres). Só administrador da conta.","x-scope":null,"x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]},"example":{"name":"Minha empresa"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pixels.list":{"post":{"operationId":"pixels.list","tags":["pixels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pixels.list.md"},"x-mcp-tool":"pixels_list","x-cli":"node cli/atomiks.mjs pixels.list --json '{...}'","x-session-only":false,"summary":"Listar pixels (datasets da Meta)","description":"Pixels da API de Conversões da Meta: o dataset de cada número oficial. `items` traz os que já têm ID guardado; `channels` traz todos os números oficiais, para escolher onde cadastrar um ID.","x-scope":"conversions:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"platform":{"type":"string","const":"meta"},"datasetId":{"type":["string","null"]},"name":{"type":["string","null"]},"displayPhone":{"type":["string","null"]},"status":{"type":"string"}},"required":["channelId","platform","datasetId","name","displayPhone","status"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"platform":{"type":"string","const":"meta"},"datasetId":{"type":["string","null"]},"name":{"type":["string","null"]},"displayPhone":{"type":["string","null"]},"status":{"type":"string"}},"required":["channelId","platform","datasetId","name","displayPhone","status"],"additionalProperties":false}}},"required":["items","channels"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pixels.add":{"post":{"operationId":"pixels.add","tags":["pixels"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/pixels.add.md"},"x-mcp-tool":"pixels_add","x-cli":"node cli/atomiks.mjs pixels.add --json '{...}'","x-session-only":false,"summary":"Cadastrar o ID do pixel de um número","description":"Guarda o ID do pixel (dataset) da Meta no número oficial escolhido. Substitui o ID anterior, se houver. Só dígitos.","x-scope":"conversions:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"datasetId":{"type":"string","pattern":"^[0-9]{5,30}$"}},"required":["channelId","datasetId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","datasetId":"123456789012345"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"platform":{"type":"string","const":"meta"},"datasetId":{"type":["string","null"]},"name":{"type":["string","null"]},"displayPhone":{"type":["string","null"]},"status":{"type":"string"}},"required":["channelId","platform","datasetId","name","displayPhone","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/overview.summary":{"post":{"operationId":"overview.summary","tags":["overview"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/overview.summary.md"},"x-mcp-tool":"overview_summary","x-cli":"node cli/atomiks.mjs overview.summary --json '{...}'","x-session-only":false,"summary":"Contagens da visão geral","description":"Contatos criados entre `from` e `to` (por `first_seen_at`, fora da lixeira), contatos totais, produtos ativos e os criados desde `todayFrom` (início do dia do chamador), automações (Instagram) e fluxos não arquivados e ativos da conta. O que o membro não vê pela RLS não entra.","x-scope":"crm:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"todayFrom":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["from","to","todayFrom"]},"example":{"from":"2026-09-27T00:00:00-03:00","to":"2026-10-26T23:59:59-03:00","todayFrom":"2026-10-26T00:00:00-03:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"contactsCreated":{"type":"number"},"contactsTotal":{"type":"number"},"products":{"type":"number"},"productsToday":{"type":"number"},"automations":{"type":"number"},"flows":{"type":"number"},"flowsActive":{"type":"number"}},"required":["contactsCreated","contactsTotal","products","productsToday","automations","flows","flowsActive"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaigns_list":{"post":{"operationId":"groups.campaigns_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaigns_list.md"},"x-mcp-tool":"groups_campaigns_list","x-cli":"node cli/atomiks.mjs groups.campaigns_list --json '{...}'","x-session-only":false,"summary":"Listar campanhas de grupos","description":"Campanhas de grupos da conta, da mais nova para a mais antiga. Paginação por `cursor` (devolvido em `nextCursor`); `status` filtra. Cada item traz `numbers` (canais vinculados: `channelId`, `name`, `phone`, `status`) e `groups` (`total`, `capturing`, `full` = lotados entre os que captam: membros + reservas >= capacidade).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cursor":{"type":"string","maxLength":100},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"status":{"type":"string","enum":["active","attention","paused","ended"]}}},"example":{"limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","attention","paused","ended"]},"timezone":{"type":"string"},"shortCode":{"type":"string"},"capacity":{"type":"number"},"rotationPolicy":{"type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"type":"number"},"reservationMinutes":{"type":"number"},"fallbackUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"numbers":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"status":{"type":"string"},"usage":{"default":"groups","type":"string","enum":["groups","both"]}},"required":["channelId","name","phone","status","usage"],"additionalProperties":false}},"groups":{"type":"object","properties":{"total":{"type":"number"},"capturing":{"type":"number"},"full":{"type":"number"}},"required":["total","capturing","full"],"additionalProperties":false}},"required":["id","name","status","timezone","shortCode","capacity","rotationPolicy","cookieDays","reservationMinutes","fallbackUrl","createdAt","numbers","groups"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_get":{"post":{"operationId":"groups.campaign_get","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_get.md"},"x-mcp-tool":"groups_campaign_get","x-cli":"node cli/atomiks.mjs groups.campaign_get --json '{...}'","x-session-only":false,"summary":"Ver uma campanha de grupos","description":"Campanha com os números (canais) vinculados e a contagem de grupos: total, captando e lotados entre os que captam.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","attention","paused","ended"]},"timezone":{"type":"string"},"shortCode":{"type":"string"},"capacity":{"type":"number"},"rotationPolicy":{"type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"type":"number"},"reservationMinutes":{"type":"number"},"fallbackUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"numbers":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"status":{"type":"string"},"usage":{"default":"groups","type":"string","enum":["groups","both"]}},"required":["channelId","name","phone","status","usage"],"additionalProperties":false}},"groups":{"type":"object","properties":{"total":{"type":"number"},"capturing":{"type":"number"},"full":{"type":"number"}},"required":["total","capturing","full"],"additionalProperties":false}},"required":["id","name","status","timezone","shortCode","capacity","rotationPolicy","cookieDays","reservationMinutes","fallbackUrl","createdAt","numbers","groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_create":{"post":{"operationId":"groups.campaign_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_create.md"},"x-mcp-tool":"groups_campaign_create","x-cli":"node cli/atomiks.mjs groups.campaign_create --json '{...}'","x-session-only":false,"summary":"Criar campanha de grupos","description":"Cria a campanha com o link principal (`shortCode`, 8 caracteres). Padrões: capacidade 1024, rotação sequencial, cookie desligado (0 dias), reserva de vaga de 10 minutos, fuso America/Sao_Paulo. `fallbackUrl` (https) recebe o clique quando não há vaga.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"capacity":{"default":1024,"type":"integer","minimum":1,"maximum":1024},"rotationPolicy":{"default":"sequential","type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"default":0,"type":"integer","minimum":0,"maximum":90},"reservationMinutes":{"default":10,"type":"integer","minimum":1,"maximum":60},"timezone":{"default":"America/Sao_Paulo","type":"string"},"fallbackUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]},"example":{"name":"Lançamento Out","capacity":1024,"rotationPolicy":"sequential","cookieDays":0,"reservationMinutes":10,"timezone":"America/Sao_Paulo"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","attention","paused","ended"]},"timezone":{"type":"string"},"shortCode":{"type":"string"},"capacity":{"type":"number"},"rotationPolicy":{"type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"type":"number"},"reservationMinutes":{"type":"number"},"fallbackUrl":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","status","timezone","shortCode","capacity","rotationPolicy","cookieDays","reservationMinutes","fallbackUrl","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_update":{"post":{"operationId":"groups.campaign_update","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_update.md"},"x-mcp-tool":"groups_campaign_update","x-cli":"node cli/atomiks.mjs groups.campaign_update --json '{...}'","x-session-only":false,"summary":"Alterar campanha de grupos","description":"Altera os campos informados; os omitidos não mudam. `status: \"ended\"` encerra a campanha e grava `ended_at`.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":120},"capacity":{"type":"integer","minimum":1,"maximum":1024},"rotationPolicy":{"type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"type":"integer","minimum":0,"maximum":90},"reservationMinutes":{"type":"integer","minimum":1,"maximum":60},"timezone":{"type":"string"},"fallbackUrl":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"status":{"type":"string","enum":["active","attention","paused","ended"]}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","cookieDays":7}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","attention","paused","ended"]},"timezone":{"type":"string"},"shortCode":{"type":"string"},"capacity":{"type":"number"},"rotationPolicy":{"type":"string","enum":["sequential","weighted","round_robin"]},"cookieDays":{"type":"number"},"reservationMinutes":{"type":"number"},"fallbackUrl":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","status","timezone","shortCode","capacity","rotationPolicy","cookieDays","reservationMinutes","fallbackUrl","createdAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_connect":{"post":{"operationId":"groups.number_connect","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_connect.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Conectar um número dedicado a Grupos (QR ou código de pareamento)","description":"Cria o número de Grupos: sessão no servidor do WhatsApp por QR com o webhook do Atomiks e canal `whatsapp_web` com `usage = groups`, em `connecting`. Devolve o QR code e, se `pairingPhone` (só dígitos com DDI, 12 a 13) vier, também o código de pareamento para digitar no celular. Use um chip exclusivo: o número de atendimento nunca entra em Grupos. Só pela interface.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"pairingPhone":{"type":"string","pattern":"^\\d{12,13}$"}},"required":["name"]},"example":{"name":"Lançamento","pairingPhone":"5511999990000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"qr":{"type":"object","properties":{"base64":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["base64","code"],"additionalProperties":false},"pairingCode":{"type":["string","null"]}},"required":["channelId","qr","pairingCode"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_status":{"post":{"operationId":"groups.number_status","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_status.md"},"x-mcp-tool":"groups_number_status","x-cli":"node cli/atomiks.mjs groups.number_status --json '{...}'","x-session-only":false,"summary":"Estado, QR e saúde de um número de Grupos","description":"Consulta a sessão do número (reinicia a que caiu); ao conectar o canal vira `ready`. Se ainda não conectou, devolve QR e código de pareamento novos. Inclui o estado do governador: pausa, suspeita de banimento e estágio de aquecimento.","x-scope":"marketing:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["connecting","ready","disconnected"]},"phone":{"type":["string","null"]},"qr":{"anyOf":[{"type":"object","properties":{"base64":{"type":["string","null"]},"code":{"type":["string","null"]}},"required":["base64","code"],"additionalProperties":false},{"type":"null"}]},"pairingCode":{"type":["string","null"]},"governor":{"type":"object","properties":{"paused_until":{"type":["string","null"]},"pause_reason":{"type":["string","null"]},"suspected_ban_at":{"type":["string","null"]},"stage":{"type":"number"},"profile":{"type":"string","enum":["auto","maximum","moderate","light","custom"]}},"required":["paused_until","pause_reason","suspected_ban_at","stage","profile"],"additionalProperties":false}},"required":["status","phone","qr","pairingCode","governor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_disconnect":{"post":{"operationId":"groups.number_disconnect","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_disconnect.md"},"x-mcp-tool":"groups_number_disconnect","x-cli":"node cli/atomiks.mjs groups.number_disconnect --json '{...}'","x-session-only":false,"summary":"Desconectar um número de Grupos","description":"Sai e apaga a sessão do número e marca o canal como desconectado. Só número de Grupos.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_number_attach":{"post":{"operationId":"groups.campaign_number_attach","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_number_attach.md"},"x-mcp-tool":"groups_campaign_number_attach","x-cli":"node cli/atomiks.mjs groups.campaign_number_attach --json '{...}'","x-session-only":false,"summary":"Vincular um número de Grupos a uma campanha","description":"Liga um número `usage = groups` ou `both` (atendimento compartilhado com Grupos) à campanha. Número só de atendimento é recusado. Repetir o vínculo não faz nada.","x-scope":"marketing:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId","channelId"]},"example":{"campaignId":"00000000-0000-0000-0000-000000000000","channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string"},"channelId":{"type":"string"}},"required":["campaignId","channelId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_number_detach":{"post":{"operationId":"groups.campaign_number_detach","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_number_detach.md"},"x-mcp-tool":"groups_campaign_number_detach","x-cli":"node cli/atomiks.mjs groups.campaign_number_detach --json '{...}'","x-session-only":false,"summary":"Desvincular um número de Grupos de uma campanha","description":"Remove o vínculo entre o número e a campanha. Sem vínculo, não faz nada.","x-scope":"marketing:write","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId","channelId"]},"example":{"campaignId":"00000000-0000-0000-0000-000000000000","channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string"},"channelId":{"type":"string"}},"required":["campaignId","channelId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.numbers_shareable":{"post":{"operationId":"groups.numbers_shareable","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.numbers_shareable.md"},"x-mcp-tool":"groups_numbers_shareable","x-cli":"node cli/atomiks.mjs groups.numbers_shareable --json '{...}'","x-session-only":false,"summary":"Números de atendimento que podem também servir a Grupos","description":"Canais `whatsapp_web` da conta com `usage = inbox` e não desconectados (`usage: \"inbox\"`: podem ser compartilhados). Com `campaignId`, inclui também os `usage = both` ainda não vinculados àquela campanha (`usage: \"both\"`: já compartilhados, prontos para vincular). Número da API oficial (Cloud API) não aparece: não serve a Grupos.","x-scope":"marketing:read","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numbers":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"status":{"type":"string"},"usage":{"type":"string","enum":["inbox","both"]}},"required":["channelId","name","phone","status","usage"],"additionalProperties":false}}},"required":["numbers"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_share":{"post":{"operationId":"groups.number_share","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_share.md"},"x-mcp-tool":null,"x-cli":null,"x-session-only":true,"summary":"Usar um número de atendimento também em Grupos","description":"Marca o número `whatsapp_web` de atendimento como `usage = both` (atendimento + Grupos), liga `receive_groups` e libera as mensagens de grupo no servidor do número. O número continua no atendimento. Exige `acceptRisk: true`. Risco: Um bloqueio do WhatsApp neste número derruba também o atendimento e os anúncios de clique para WhatsApp desse número. Número da API oficial (Cloud API) é recusado: não serve a Grupos. Só pela interface, só admin.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"acceptRisk":{"default":false,"type":"boolean"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000","acceptRisk":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"usage":{"type":"string","const":"both"}},"required":["channelId","usage"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_unshare":{"post":{"operationId":"groups.number_unshare","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_unshare.md"},"x-mcp-tool":"groups_number_unshare","x-cli":"node cli/atomiks.mjs groups.number_unshare --json '{...}'","x-session-only":false,"summary":"Tirar um número compartilhado de Grupos","description":"Volta o número `both` para só atendimento (`usage = inbox`): desvincula de todas as campanhas e cancela os jobs `queued` ou `running` desse número com o motivo \"Número saiu de Grupos\". O atendimento não muda. Funciona também com o número desconectado.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"usage":{"type":"string","const":"inbox"},"detachedCampaigns":{"type":"number"},"canceledJobs":{"type":"number"}},"required":["channelId","usage","detachedCampaigns","canceledJobs"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.governor_status":{"post":{"operationId":"groups.governor_status","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.governor_status.md"},"x-mcp-tool":"groups_governor_status","x-cli":"node cli/atomiks.mjs groups.governor_status --json '{...}'","x-session-only":false,"summary":"Saúde e limites de um número de Grupos","description":"Perfil de segurança, estágio efetivo, pausa, suspeita de banimento e uso por ação na última hora e no último dia, com os tetos vigentes (maior versão da tabela de limites).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"profile":{"type":"string","enum":["auto","maximum","moderate","light","custom"]},"stage":{"type":"number"},"version":{"type":["number","null"]},"pausedUntil":{"type":["string","null"]},"pauseReason":{"type":["string","null"]},"suspectedBanAt":{"type":["string","null"]},"usage":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"hour":{"type":"number"},"day":{"type":"number"},"perHour":{"type":["number","null"]},"perDay":{"type":["number","null"]}},"required":["action","hour","day","perHour","perDay"],"additionalProperties":false}}},"required":["profile","stage","version","pausedUntil","pauseReason","suspectedBanAt","usage"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_profile_get":{"post":{"operationId":"groups.number_profile_get","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_profile_get.md"},"x-mcp-tool":"groups_number_profile_get","x-cli":"node cli/atomiks.mjs groups.number_profile_get --json '{...}'","x-session-only":false,"summary":"Perfil de segurança de um número de Grupos, com recomendação e limites dos presets","description":"Devolve o perfil (`auto`, `maximum`, `moderate`, `light` ou `custom`), os limites personalizados gravados, o estágio efetivo (Máxima = 0, Moderada = 2, Leve e Personalizada = 3, Automático pela idade), os dias desde a primeira conexão no Atomiks, a recomendação (menos de 3 dias: Máxima; menos de 14: Moderada; senão Leve — número antigo e usado no WhatsApp pode ir para Moderada ou Leve) e os limites por ação de cada preset (maior versão da tabela de limites).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"profile":{"type":"string","enum":["auto","maximum","moderate","light","custom"]},"customLimits":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"number"},"perDay":{"type":"number"},"minGapMs":{"type":"number"}},"required":["perHour","perDay","minGapMs"],"additionalProperties":false}},{"type":"null"}]},"effectiveStage":{"type":"number"},"ageDays":{"type":"number"},"recommended":{"type":"string","enum":["maximum","moderate","light"]},"presets":{"type":"object","properties":{"maximum":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"number"},"perDay":{"type":"number"},"minGapMs":{"type":"number"}},"required":["perHour","perDay","minGapMs"],"additionalProperties":false}},"moderate":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"number"},"perDay":{"type":"number"},"minGapMs":{"type":"number"}},"required":["perHour","perDay","minGapMs"],"additionalProperties":false}},"light":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"number"},"perDay":{"type":"number"},"minGapMs":{"type":"number"}},"required":["perHour","perDay","minGapMs"],"additionalProperties":false}}},"required":["maximum","moderate","light"],"additionalProperties":false}},"required":["profile","customLimits","effectiveStage","ageDays","recommended","presets"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.number_profile_set":{"post":{"operationId":"groups.number_profile_set","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.number_profile_set.md"},"x-mcp-tool":"groups_number_profile_set","x-cli":"node cli/atomiks.mjs groups.number_profile_set --json '{...}'","x-session-only":false,"summary":"Definir o perfil de segurança de um número de Grupos","description":"Grava o perfil do número; vale já no próximo item de um disparo em andamento. Em `custom`, `customLimits` traz por ação `{perHour, perDay, minGapMs}`; o servidor recusa `perHour` ou `perDay` acima de 2 vezes o valor da Leve, `minGapMs` abaixo de 500 e qualquer valor acima de 0 em `add_participant`. Ações não informadas usam os valores da Leve. Em outros perfis `customLimits` é ignorado e os limites personalizados já gravados ficam guardados.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"profile":{"type":"string","enum":["auto","maximum","moderate","light","custom"]},"customLimits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"integer","minimum":0,"maximum":9007199254740991},"perDay":{"type":"integer","minimum":0,"maximum":9007199254740991},"minGapMs":{"type":"integer","minimum":0,"maximum":3600000}},"required":["perHour","perDay","minGapMs"]}}},"required":["channelId","profile"]},"example":{"channelId":"00000000-0000-4000-8000-000000000001","profile":"moderate"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string"},"profile":{"type":"string","enum":["auto","maximum","moderate","light","custom"]},"customLimits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"perHour":{"type":"number"},"perDay":{"type":"number"},"minGapMs":{"type":"number"}},"required":["perHour","perDay","minGapMs"],"additionalProperties":false}}},"required":["channelId","profile"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.governor_clear_ban":{"post":{"operationId":"groups.governor_clear_ban","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.governor_clear_ban.md"},"x-mcp-tool":"groups_governor_clear_ban","x-cli":"node cli/atomiks.mjs groups.governor_clear_ban --json '{...}'","x-session-only":false,"summary":"Limpar a suspeita de banimento de um número de Grupos","description":"Zera `suspected_ban_at` depois que alguém confirmou que o número está saudável. Não mexe na pausa nem nos limites.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["channelId"]},"example":{"channelId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cleared":{"type":"boolean"}},"required":["cleared"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.member_events_list":{"post":{"operationId":"groups.member_events_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.member_events_list.md"},"x-mcp-tool":"groups_member_events_list","x-cli":"node cli/atomiks.mjs groups.member_events_list --json '{...}'","x-session-only":false,"summary":"Eventos recentes de entrada e saída de uma campanha","description":"Eventos de participantes (entrou, saiu, promovido, rebaixado) do mais recente ao mais antigo; o participante vem mascarado com os 4 últimos dígitos. Paginação por `cursor` (id do último evento recebido).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"cursor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","limit":50}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"groupId":{"type":"string"},"participant":{"type":"string"},"action":{"type":"string"},"occurredAt":{"type":"string"},"source":{"type":"string"}},"required":["id","groupId","participant","action","occurredAt","source"],"additionalProperties":false}},"nextCursor":{"type":["number","null"]}},"required":["events","nextCursor"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_list":{"post":{"operationId":"groups.groups_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_list.md"},"x-mcp-tool":"groups_groups_list","x-cli":"node cli/atomiks.mjs groups.groups_list --json '{...}'","x-session-only":false,"summary":"Listar grupos de uma campanha","description":"Grupos vivos da campanha por `position`, 50 por página (até 100). Paginação por `cursor` (devolvido em `nextCursor`), busca por nome e filtros rodam no servidor: `capturing`, `paused`, `full` (membros + reservas >= capacidade), `invalid_link`, `issues` (sem acesso ou link inválido). `folderId` aceita `none`; `linkId` aceita `main` (link principal). Cada grupo traz a ocupação real.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"cursor":{"type":"string","maxLength":20},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100},"search":{"type":"string","maxLength":100},"filter":{"default":"all","type":"string","enum":["all","capturing","paused","full","invalid_link","issues"]},"folderId":{"anyOf":[{"type":"string","const":"none"},{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]},"linkId":{"anyOf":[{"type":"string","const":"main"},{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}]}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","limit":50,"filter":"all"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"jid":{"type":"string"},"name":{"type":["string","null"]},"position":{"type":"number"},"memberCount":{"type":"number"},"reservedCount":{"type":"number"},"capacity":{"type":"number"},"occupancyPct":{"type":"number"},"captureActive":{"type":"boolean"},"inviteStatus":{"type":"string"},"isAdmin":{"type":["boolean","null"]},"accessIssue":{"type":["string","null"]},"folderId":{"type":["string","null"]},"linkId":{"type":["string","null"]},"channelId":{"type":["string","null"]},"lastJoinAt":{"type":["string","null"]}},"required":["id","jid","name","position","memberCount","reservedCount","capacity","occupancyPct","captureActive","inviteStatus","isAdmin","accessIssue","folderId","linkId","channelId","lastJoinAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":"number"}},"required":["items","nextCursor","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_update_bulk":{"post":{"operationId":"groups.groups_update_bulk","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_update_bulk.md"},"x-mcp-tool":"groups_groups_update_bulk","x-cli":"node cli/atomiks.mjs groups.groups_update_bulk --json '{...}'","x-session-only":false,"summary":"Alterar vários grupos de uma vez","description":"Liga/desliga a captação (`captureActive`), move para uma pasta (`folderId`, `null` tira da pasta) ou para um link de captação (`linkId`, `null` = link principal). Só grupos vivos da campanha; pasta e link têm que ser da campanha. Devolve quantos mudaram.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"groupIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"set":{"type":"object","properties":{"captureActive":{"type":"boolean"},"folderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}},"required":["campaignId","groupIds","set"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","groupIds":["00000000-0000-4000-8000-000000000001"],"set":{"captureActive":false}}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_remove_bulk":{"post":{"operationId":"groups.groups_remove_bulk","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_remove_bulk.md"},"x-mcp-tool":"groups_groups_remove_bulk","x-cli":"node cli/atomiks.mjs groups.groups_remove_bulk --json '{...}'","x-session-only":false,"summary":"Remover grupos da campanha","description":"Tira os grupos da rotação (`deleted_at`). O número NÃO sai do grupo no WhatsApp e o grupo continua existindo lá; ele só deixa de aparecer e de receber captação aqui.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"groupIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["campaignId","groupIds"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","groupIds":["00000000-0000-4000-8000-000000000001"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"removed":{"type":"number"}},"required":["removed"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_reorder":{"post":{"operationId":"groups.groups_reorder","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_reorder.md"},"x-mcp-tool":"groups_groups_reorder","x-cli":"node cli/atomiks.mjs groups.groups_reorder --json '{...}'","x-session-only":false,"summary":"Reordenar grupos","description":"Grava `position` = posição na lista (a partir de 1) para os grupos informados, na ordem dada. Os não informados não mudam.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"groupIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["campaignId","groupIds"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","groupIds":["00000000-0000-4000-8000-000000000001"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.whatsapp_groups":{"post":{"operationId":"groups.whatsapp_groups","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.whatsapp_groups.md"},"x-mcp-tool":"groups_whatsapp_groups","x-cli":"node cli/atomiks.mjs groups.whatsapp_groups --json '{...}'","x-session-only":false,"summary":"Listar os grupos que o número já tem no WhatsApp","description":"Consulta a Evolution API (passa pelo governador, ação `fetch_group`) e devolve os grupos do número com `description` (nula quando não há), marcando os que já estão na campanha (`alreadyInCampaign`). Só admin: gasta o orçamento do número e alimenta a importação. O número precisa estar vinculado à campanha e o usuário precisa poder usá-lo. Se o governador negar, responde `limit_reached` com a espera.","x-scope":"marketing:write","x-access":"admin","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId","channelId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","channelId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"announce":{"type":"boolean"},"description":{"type":["string","null"]},"alreadyInCampaign":{"type":"boolean"}},"required":["jid","name","size","announce","description","alreadyInCampaign"],"additionalProperties":false}}},"required":["groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_import":{"post":{"operationId":"groups.groups_import","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_import.md"},"x-mcp-tool":"groups_groups_import","x-cli":"node cli/atomiks.mjs groups.groups_import --json '{...}'","x-session-only":false,"summary":"Importar grupos do WhatsApp para a campanha","description":"Grava até 500 grupos (a ordem dada vira a ordem de `position`) e enfileira a busca do convite e do acesso do número em cada grupo novo ou sem convite válido. Importar de novo não duplica: os existentes só atualizam nome, descrição e tipo de envio e mantêm posição, contadores e captação. O número precisa estar vinculado à campanha e conectado. `jobId` é nulo quando não há nada a buscar.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"groups":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"jid":{"type":"string","maxLength":100,"pattern":"@g\\.us$"},"name":{"type":"string","maxLength":200},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"announce":{"type":"boolean"},"description":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]}},"required":["jid","name"]}}},"required":["campaignId","channelId","groups"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","channelId":"00000000-0000-4000-8000-000000000001","groups":[{"jid":"120363000000000001@g.us","name":"Lançamento #001","size":12}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"inserted":{"type":"number"},"existing":{"type":"number"},"jobId":{"type":["string","null"]}},"required":["inserted","existing","jobId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_create_preview":{"post":{"operationId":"groups.groups_create_preview","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_create_preview.md"},"x-mcp-tool":"groups_groups_create_preview","x-cli":"node cli/atomiks.mjs groups.groups_create_preview --json '{...}'","x-session-only":false,"summary":"Estimar quanto leva criar grupos em lote","description":"Conta o tempo mínimo para criar `count` grupos com os limites vigentes da ação `create_group` no estágio do número e o que ele já usou hoje. `minutes` é nulo se o limite atual não permite criar. `fitsToday`: cabe no teto do dia.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"count":{"type":"integer","minimum":1,"maximum":100}},"required":["campaignId","channelId","count"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","channelId":"00000000-0000-4000-8000-000000000001","count":30}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"minutes":{"type":["number","null"]},"fitsToday":{"type":"boolean"},"stage":{"type":"number"},"perDay":{"type":"number"},"usedToday":{"type":"number"}},"required":["minutes","fitsToday","stage","perDay","usedToday"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.groups_create":{"post":{"operationId":"groups.groups_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.groups_create.md"},"x-mcp-tool":"groups_groups_create","x-cli":"node cli/atomiks.mjs groups.groups_create --json '{...}'","x-session-only":false,"summary":"Criar grupos numerados em lote","description":"Enfileira a criação de `count` (1 a 100) grupos chamados \"<baseName> #NNN\" (3 dígitos). `startNumber` padrão = maior número já usado com essa base na campanha (inclusive em jobs ainda na fila) + 1. A criação roda pelo governador, um por vez; o número precisa estar vinculado à campanha. `adminPhones` (1 a 5, só dígitos com DDI, 12 a 13) é obrigatório: a Evolution não cria grupo sem participante, então os números da equipe do lançador entram na criação e viram admins. `onlyAdminsSend` (padrão ligado) deixa só admins enviarem. `pictureUrl` precisa ser https.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"channelId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"baseName":{"type":"string","minLength":1,"maxLength":60},"startNumber":{"type":"integer","minimum":1,"maximum":999},"count":{"type":"integer","minimum":1,"maximum":100},"description":{"type":"string","maxLength":512},"pictureUrl":{"type":"string","maxLength":2000},"onlyAdminsSend":{"default":true,"type":"boolean"},"adminPhones":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","pattern":"^\\d{12,13}$"}}},"required":["campaignId","channelId","baseName","count","adminPhones"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","channelId":"00000000-0000-4000-8000-000000000001","baseName":"Lançamento","count":3,"onlyAdminsSend":true,"adminPhones":["5511999990000"]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"names":{"type":"array","items":{"type":"string"}}},"required":["jobId","names"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.access_check":{"post":{"operationId":"groups.access_check","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.access_check.md"},"x-mcp-tool":"groups_access_check","x-cli":"node cli/atomiks.mjs groups.access_check --json '{...}'","x-session-only":false,"summary":"Conferir se o número participa e é admin dos grupos","description":"Enfileira um job por número que confere, em cada grupo vivo da campanha, se o número participa, se é admin e se o link de convite vale. Grupos sem número vão para o primeiro número vinculado. Recusa se já há uma conferência em andamento. `jobId` é o primeiro job; `jobIds` traz todos.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":["string","null"]},"jobIds":{"type":"array","items":{"type":"string"}},"total":{"type":"number"}},"required":["jobId","jobIds","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.jobs_list":{"post":{"operationId":"groups.jobs_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.jobs_list.md"},"x-mcp-tool":"groups_jobs_list","x-cli":"node cli/atomiks.mjs groups.jobs_list --json '{...}'","x-session-only":false,"summary":"Listar jobs de grupos da campanha","description":"Jobs de importar, criar e conferir acesso (os internos de conferência de tamanho não aparecem), do mais novo ao mais antigo, com progresso (`done`/`total`/`failed`), próxima tentativa (`nextAt`) e o motivo da espera (`lastReason`).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"default":20,"type":"integer","minimum":1,"maximum":50}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","limit":20}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"nextAt":{"type":["string","null"]},"lastReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","status","total","done","failed","nextAt","lastReason","createdAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.job_get":{"post":{"operationId":"groups.job_get","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.job_get.md"},"x-mcp-tool":"groups_job_get","x-cli":"node cli/atomiks.mjs groups.job_get --json '{...}'","x-session-only":false,"summary":"Ver um job de grupos","description":"O job com os 200 primeiros itens (posição, estado, erro e nome do grupo quando há).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"nextAt":{"type":["string","null"]},"lastReason":{"type":["string","null"]},"createdAt":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"status":{"type":"string"},"error":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["position","status","error","name"],"additionalProperties":false}}},"required":["id","kind","status","total","done","failed","nextAt","lastReason","createdAt","items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.job_cancel":{"post":{"operationId":"groups.job_cancel","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.job_cancel.md"},"x-mcp-tool":"groups_job_cancel","x-cli":"node cli/atomiks.mjs groups.job_cancel --json '{...}'","x-session-only":false,"summary":"Cancelar um job de grupos","description":"Cancela um job `queued` ou `running`: nenhum item novo roda. O que já foi feito no WhatsApp fica. Job que já terminou responde `invalid_input`.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.folders_list":{"post":{"operationId":"groups.folders_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.folders_list.md"},"x-mcp-tool":"groups_folders_list","x-cli":"node cli/atomiks.mjs groups.folders_list --json '{...}'","x-session-only":false,"summary":"Listar pastas de grupos da campanha","description":"Pastas da campanha por nome, com quantos grupos vivos há em cada uma.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groups":{"type":"number"}},"required":["id","name","groups"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.folder_create":{"post":{"operationId":"groups.folder_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.folder_create.md"},"x-mcp-tool":"groups_folder_create","x-cli":"node cli/atomiks.mjs groups.folder_create --json '{...}'","x-session-only":false,"summary":"Criar pasta de grupos","description":"Cria uma pasta na campanha. Nome repetido (sem diferenciar maiúsculas) responde `invalid_input`.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":60}},"required":["campaignId","name"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","name":"Turma 1"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groups":{"type":"number"}},"required":["id","name","groups"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.folder_rename":{"post":{"operationId":"groups.folder_rename","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.folder_rename.md"},"x-mcp-tool":"groups_folder_rename","x-cli":"node cli/atomiks.mjs groups.folder_rename --json '{...}'","x-session-only":false,"summary":"Renomear pasta de grupos","description":"Troca o nome da pasta. Nome repetido na campanha responde `invalid_input`.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":60}},"required":["id","name"]},"example":{"id":"00000000-0000-4000-8000-000000000001","name":"Turma 2"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.folder_delete":{"post":{"operationId":"groups.folder_delete","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.folder_delete.md"},"x-mcp-tool":"groups_folder_delete","x-cli":"node cli/atomiks.mjs groups.folder_delete --json '{...}'","x-session-only":false,"summary":"Excluir pasta de grupos","description":"Apaga a pasta. Os grupos que estavam nela ficam sem pasta; nenhum grupo é removido.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.links_list":{"post":{"operationId":"groups.links_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.links_list.md"},"x-mcp-tool":"groups_links_list","x-cli":"node cli/atomiks.mjs groups.links_list --json '{...}'","x-session-only":false,"summary":"Listar links de captação da campanha","description":"Link principal da campanha (`main`: código, URL pública `/g/<código>` e quantos grupos usam o link principal) e links extras vivos (`extras`, com política de rotação própria, grupos e cliques dos últimos 7 dias).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"main":{"type":"object","properties":{"code":{"type":"string"},"url":{"type":"string"},"groups":{"type":"number"}},"required":["code","url","groups"],"additionalProperties":false},"extras":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"url":{"type":"string"},"rotationPolicy":{"anyOf":[{"type":"string","enum":["sequential","weighted","round_robin"]},{"type":"null"}]},"groups":{"type":"number"},"clicks7d":{"type":"number"}},"required":["id","name","code","url","rotationPolicy","groups","clicks7d"],"additionalProperties":false}}},"required":["main","extras"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.link_create":{"post":{"operationId":"groups.link_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.link_create.md"},"x-mcp-tool":"groups_link_create","x-cli":"node cli/atomiks.mjs groups.link_create --json '{...}'","x-session-only":false,"summary":"Criar link extra de captação","description":"Cria um link extra para a campanha (`/g/<código>`, código único entre campanhas e links). `rotationPolicy` nulo usa a política da campanha. Depois associe grupos ao link com `groups.groups_update_bulk` (`linkId`).","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"rotationPolicy":{"anyOf":[{"type":"string","enum":["sequential","weighted","round_robin"]},{"type":"null"}]}},"required":["campaignId","name"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","name":"Instagram"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"url":{"type":"string"},"rotationPolicy":{"anyOf":[{"type":"string","enum":["sequential","weighted","round_robin"]},{"type":"null"}]},"groups":{"type":"number"},"clicks7d":{"type":"number"}},"required":["id","name","code","url","rotationPolicy","groups","clicks7d"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.link_update":{"post":{"operationId":"groups.link_update","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.link_update.md"},"x-mcp-tool":"groups_link_update","x-cli":"node cli/atomiks.mjs groups.link_update --json '{...}'","x-session-only":false,"summary":"Alterar link extra de captação","description":"Renomeia o link extra e/ou muda a política de rotação (`null` volta a usar a da campanha).","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":80},"rotationPolicy":{"anyOf":[{"type":"string","enum":["sequential","weighted","round_robin"]},{"type":"null"}]}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001","name":"Instagram stories"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"url":{"type":"string"},"rotationPolicy":{"anyOf":[{"type":"string","enum":["sequential","weighted","round_robin"]},{"type":"null"}]},"groups":{"type":"number"},"clicks7d":{"type":"number"}},"required":["id","name","code","url","rotationPolicy","groups","clicks7d"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.link_delete":{"post":{"operationId":"groups.link_delete","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.link_delete.md"},"x-mcp-tool":"groups_link_delete","x-cli":"node cli/atomiks.mjs groups.link_delete --json '{...}'","x-session-only":false,"summary":"Excluir link extra de captação","description":"Marca o link como excluído (o código deixa de funcionar) e devolve os grupos dele ao link principal da campanha.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.rotation_now":{"post":{"operationId":"groups.rotation_now","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.rotation_now.md"},"x-mcp-tool":"groups_rotation_now","x-cli":"node cli/atomiks.mjs groups.rotation_now --json '{...}'","x-session-only":false,"summary":"Ver quem recebe agora na rotação","description":"Grupo que a política escolheria agora e o seguinte (sem reservar vaga), para o link principal (`linkId` nulo) ou um link extra, mais a política em uso, as vagas livres e quantos grupos ainda têm vaga.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groupId":{"type":["string","null"]},"name":{"type":["string","null"]},"memberCount":{"type":["number","null"]},"reservedCount":{"type":["number","null"]},"capacity":{"type":["number","null"]},"nextGroupId":{"type":["string","null"]},"nextName":{"type":["string","null"]},"policy":{"type":"string","enum":["sequential","weighted","round_robin"]},"freeSeats":{"type":"number"},"groupsWithSeats":{"type":"number"}},"required":["groupId","name","memberCount","reservedCount","capacity","nextGroupId","nextName","policy","freeSeats","groupsWithSeats"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.rotation_simulate":{"post":{"operationId":"groups.rotation_simulate","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.rotation_simulate.md"},"x-mcp-tool":"groups_rotation_simulate","x-cli":"node cli/atomiks.mjs groups.rotation_simulate --json '{...}'","x-session-only":false,"summary":"Simular a rotação antes de lançar","description":"Simula `clicks` cliques (1 a 20000) na rotação do link principal (`linkId` nulo) ou de um link extra, com `joinRate` (0 a 1, padrão 0,8) de entradas. Nada é gravado. Devolve `{perGroup: [{groupId, name, clicks, joins, fullAtClick}], firstFullAt, noSeatAt, totalReserved}`.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clicks":{"type":"integer","minimum":1,"maximum":20000},"joinRate":{"default":0.8,"type":"number","minimum":0,"maximum":1}},"required":["campaignId","clicks"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","clicks":5000,"joinRate":0.8}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.click_stats":{"post":{"operationId":"groups.click_stats","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.click_stats.md"},"x-mcp-tool":"groups_click_stats","x-cli":"node cli/atomiks.mjs groups.click_stats --json '{...}'","x-session-only":false,"summary":"Estatísticas de cliques da campanha","description":"Cliques e entradas no período (`from`/`to` em ISO 8601, no máximo 90 dias), agrupados por `hour` ou `day`: `{series: [{at, clicks, joins}], byDevice, byOrigin: [{host, clicks}], byUtmSource: [{source, clicks}], byGroup: [{groupId, name, clicks, joins}]}`. Entradas são eventos reais de entrada no período.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"bucket":{"type":"string","enum":["hour","day"]}},"required":["campaignId","from","to","bucket"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","from":"2026-10-19T00:00:00Z","to":"2026-10-26T00:00:00Z","bucket":"day"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.alerts_list":{"post":{"operationId":"groups.alerts_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.alerts_list.md"},"x-mcp-tool":"groups_alerts_list","x-cli":"node cli/atomiks.mjs groups.alerts_list --json '{...}'","x-session-only":false,"summary":"Listar alertas da campanha","description":"Alertas da campanha (`no_seat`, `number_disconnected`, `invite_invalid`, `near_full`), os mais recentes primeiro. `open` (padrão verdadeiro) devolve só os não resolvidos. Cada alerta conta quantas vezes se repetiu (`count`).","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"open":{"default":true,"type":"boolean"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","open":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"openedAt":{"type":"string"},"lastSeenAt":{"type":"string"},"count":{"type":"number"},"resolvedAt":{"type":["string","null"]}},"required":["id","kind","details","openedAt","lastSeenAt","count","resolvedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.alert_resolve":{"post":{"operationId":"groups.alert_resolve","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.alert_resolve.md"},"x-mcp-tool":"groups_alert_resolve","x-cli":"node cli/atomiks.mjs groups.alert_resolve --json '{...}'","x-session-only":false,"summary":"Resolver alerta da campanha","description":"Marca o alerta como resolvido. Se o problema voltar, um novo alerta do mesmo tipo é aberto.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.messages_list":{"post":{"operationId":"groups.messages_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.messages_list.md"},"x-mcp-tool":"groups_messages_list","x-cli":"node cli/atomiks.mjs groups.messages_list --json '{...}'","x-session-only":false,"summary":"Listar mensagens de grupos","description":"Mensagens da biblioteca da campanha, da mais recente alterada para a mais antiga. `search` filtra por título ou texto; `kind` por tipo.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"search":{"type":"string","maxLength":120},"kind":{"type":"string","enum":["text","media","link","poll","contact"]}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"type":["string","null"]},"media":{"anyOf":[{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"],"additionalProperties":false},{"type":"null"}]},"poll":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options","selectable"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"],"additionalProperties":false},{"type":"null"}]},"mentionAll":{"type":"boolean"},"isWelcome":{"type":"boolean"},"version":{"type":"number"},"updatedAt":{"type":"string"}},"required":["id","title","kind","body","media","poll","contact","mentionAll","isWelcome","version","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.message_get":{"post":{"operationId":"groups.message_get","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.message_get.md"},"x-mcp-tool":"groups_message_get","x-cli":"node cli/atomiks.mjs groups.message_get --json '{...}'","x-session-only":false,"summary":"Ver uma mensagem de grupos","description":"Mensagem da biblioteca com conteúdo, versão e se é a boas-vindas.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"type":["string","null"]},"media":{"anyOf":[{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"],"additionalProperties":false},{"type":"null"}]},"poll":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options","selectable"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"],"additionalProperties":false},{"type":"null"}]},"mentionAll":{"type":"boolean"},"isWelcome":{"type":"boolean"},"version":{"type":"number"},"updatedAt":{"type":"string"}},"required":["id","title","kind","body","media","poll","contact","mentionAll","isWelcome","version","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.message_create":{"post":{"operationId":"groups.message_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.message_create.md"},"x-mcp-tool":"groups_message_create","x-cli":"node cli/atomiks.mjs groups.message_create --json '{...}'","x-session-only":false,"summary":"Criar mensagem de grupos","description":"Cria a mensagem. `kind`: `text` (texto obrigatório), `link` (texto com um endereço https://), `media` (`media` vem do upload em `/api/v1/grupos-media`; `body` é a legenda), `poll` (2 a 12 opções de até 100 caracteres), `contact` (telefone com 12 ou 13 dígitos). Texto até 4.096 caracteres e variação `{a|b}` válida. `isWelcome: true` desmarca a boas-vindas anterior da campanha.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"type":"string","maxLength":4096},"media":{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"]},"poll":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options"]},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"]},"mentionAll":{"default":false,"type":"boolean"},"isWelcome":{"default":false,"type":"boolean"}},"required":["campaignId","title","kind"]},"example":{"campaignId":"00000000-0000-0000-0000-000000000000","title":"Boas-vindas","kind":"text","body":"{Oi|Olá}! Seja bem-vindo.","mentionAll":false,"isWelcome":true}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"type":["string","null"]},"media":{"anyOf":[{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"],"additionalProperties":false},{"type":"null"}]},"poll":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options","selectable"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"],"additionalProperties":false},{"type":"null"}]},"mentionAll":{"type":"boolean"},"isWelcome":{"type":"boolean"},"version":{"type":"number"},"updatedAt":{"type":"string"}},"required":["id","title","kind","body","media","poll","contact","mentionAll","isWelcome","version","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.message_update":{"post":{"operationId":"groups.message_update","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.message_update.md"},"x-mcp-tool":"groups_message_update","x-cli":"node cli/atomiks.mjs groups.message_update --json '{...}'","x-session-only":false,"summary":"Alterar mensagem de grupos","description":"Altera os campos informados e sobe a `version`; o conteúdo final é validado de novo por tipo. Agendamentos com conteúdo congelado não mudam.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}]},"media":{"anyOf":[{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"]},{"type":"null"}]},"poll":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options"]},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"]},{"type":"null"}]},"mentionAll":{"type":"boolean"},"isWelcome":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000","body":"Novo texto"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["text","media","link","poll","contact"]},"body":{"type":["string","null"]},"media":{"anyOf":[{"type":"object","properties":{"storagePath":{"type":"string","minLength":1,"maxLength":500},"mime":{"type":"string","maxLength":100},"mediaKind":{"type":"string","enum":["image","video","audio","document"]},"fileName":{"type":"string","minLength":1,"maxLength":200},"size":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["storagePath","mime","mediaKind","fileName","size"],"additionalProperties":false},{"type":"null"}]},"poll":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"options":{"maxItems":12,"type":"array","items":{"type":"string","maxLength":100}},"selectable":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["name","options","selectable"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":30}},"required":["name","phone"],"additionalProperties":false},{"type":"null"}]},"mentionAll":{"type":"boolean"},"isWelcome":{"type":"boolean"},"version":{"type":"number"},"updatedAt":{"type":"string"}},"required":["id","title","kind","body","media","poll","contact","mentionAll","isWelcome","version","updatedAt"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.message_delete":{"post":{"operationId":"groups.message_delete","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.message_delete.md"},"x-mcp-tool":"groups_message_delete","x-cli":"node cli/atomiks.mjs groups.message_delete --json '{...}'","x-session-only":false,"summary":"Apagar mensagem de grupos","description":"Apaga a mensagem da biblioteca (some da lista; disparos e agendamentos congelados não mudam). Apagar a boas-vindas desliga o envio automático até haver outra.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-0000-0000-000000000000"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.message_preview":{"post":{"operationId":"groups.message_preview","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.message_preview.md"},"x-mcp-tool":"groups_message_preview","x-cli":"node cli/atomiks.mjs groups.message_preview --json '{...}'","x-session-only":false,"summary":"Prévia da variação de texto","description":"Sorteia 3 variações do texto com `{a|b|c}` e diz se a sintaxe é válida (`valid`). Texto inválido devolve `samples` vazio.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","maxLength":4096}},"required":["body"]},"example":{"body":"{Oi|Olá}, tudo bem?"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"samples":{"type":"array","items":{"type":"string"}},"valid":{"type":"boolean"}},"required":["samples","valid"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.welcome_settings":{"post":{"operationId":"groups.welcome_settings","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.welcome_settings.md"},"x-mcp-tool":"groups_welcome_settings","x-cli":"node cli/atomiks.mjs groups.welcome_settings --json '{...}'","x-session-only":false,"summary":"Boas-vindas da campanha","description":"Sem campos além de `campaignId`, lê a configuração (qualquer membro). Com `enabled`, `windowMinutes` (1 a 60, agrupa quem entra) ou `hours` (`HH:MM-HH:MM` no fuso da campanha), grava (administrador, escopo marketing:write). `messageId` é a mensagem marcada como boas-vindas; sem ela, ligar não envia nada.","x-scope":"marketing:read","x-access":"member","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"type":"boolean"},"windowMinutes":{"type":"integer","minimum":1,"maximum":60},"hours":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d-([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-0000-0000-000000000000","enabled":true,"windowMinutes":5,"hours":"08:00-22:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string"},"enabled":{"type":"boolean"},"windowMinutes":{"type":"number"},"hours":{"type":"string"},"messageId":{"type":["string","null"]}},"required":["campaignId","enabled","windowMinutes","hours","messageId"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.send_now":{"post":{"operationId":"groups.send_now","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.send_now.md"},"x-mcp-tool":"groups_send_now","x-cli":"node cli/atomiks.mjs groups.send_now --json '{...}'","x-session-only":false,"summary":"Enviar uma mensagem agora para os grupos","description":"Enfileira o envio da mensagem para o alvo (`{all: true}`, `{folderId}`, `{linkId}` com `null` = link principal, ou `{groupIds}`), resolvido na hora, só grupos vivos com número. O conteúdo fica congelado no job. `speed`: `slow` 6 s, `normal` 2 s, `fast` 1,25 s entre grupos do mesmo número. Cria um job por número; `total` = grupos (0 = nada a enviar).","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"],"additionalProperties":false},{"type":"object","properties":{"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["folderId"],"additionalProperties":false},{"type":"object","properties":{"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["linkId"],"additionalProperties":false},{"type":"object","properties":{"groupIds":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["groupIds"],"additionalProperties":false}]},"speed":{"default":"normal","type":"string","enum":["slow","normal","fast"]}},"required":["campaignId","messageId","target"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","messageId":"00000000-0000-4000-8000-000000000001","target":{"all":true},"speed":"normal"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobIds":{"type":"array","items":{"type":"string"}},"total":{"type":"number"}},"required":["jobIds","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedules_list":{"post":{"operationId":"groups.schedules_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedules_list.md"},"x-mcp-tool":"groups_schedules_list","x-cli":"node cli/atomiks.mjs groups.schedules_list --json '{...}'","x-session-only":false,"summary":"Listar agendamentos de mensagens da campanha","description":"Agendamentos da campanha (mais recentes primeiro), com as próximas 5 datas (`nextRuns`, no fuso da campanha) dos que estão `scheduled`. `state`: `scheduled`, `paused`, `done` ou `canceled`.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"state":{"type":"string","enum":["scheduled","paused","done","canceled"]}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","state":"scheduled"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":["string","null"]},"title":{"type":["string","null"]},"kind":{"type":"string","enum":["once","recurring"]},"runAt":{"type":["string","null"]},"weekdays":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeOfDay":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"nextRuns":{"type":"array","items":{"type":"string"}},"state":{"type":"string"},"target":{},"speed":{"type":"string"},"useLatest":{"type":"boolean"},"version":{"type":"number"},"lastRunAt":{"type":["string","null"]},"lastJobIds":{"type":"array","items":{"type":"string"}}},"required":["id","messageId","title","kind","runAt","weekdays","timeOfDay","nextRunAt","nextRuns","state","target","speed","useLatest","version","lastRunAt","lastJobIds"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedule_create":{"post":{"operationId":"groups.schedule_create","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedule_create.md"},"x-mcp-tool":"groups_schedule_create","x-cli":"node cli/atomiks.mjs groups.schedule_create --json '{...}'","x-session-only":false,"summary":"Agendar o envio de uma mensagem","description":"Agenda a mensagem para o alvo. `kind: once` exige `runAt` (ISO com fuso, pelo menos 2 minutos no futuro); `recurring` exige `weekdays` (0 = domingo a 6) e `timeOfDay` `HH:MM` no fuso da campanha. O conteúdo fica congelado, a menos que `useLatest` seja verdadeiro (usa a versão atual da mensagem na hora de enviar). Devolve `warnings`: outro agendamento a menos de 10 minutos do próximo disparo, ou alvo sem grupos hoje.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"],"additionalProperties":false},{"type":"object","properties":{"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["folderId"],"additionalProperties":false},{"type":"object","properties":{"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["linkId"],"additionalProperties":false},{"type":"object","properties":{"groupIds":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["groupIds"],"additionalProperties":false}]},"speed":{"default":"normal","type":"string","enum":["slow","normal","fast"]},"kind":{"type":"string","enum":["once","recurring"]},"runAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"useLatest":{"default":false,"type":"boolean"}},"required":["campaignId","messageId","target","kind"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","messageId":"00000000-0000-4000-8000-000000000001","target":{"all":true},"speed":"normal","kind":"recurring","weekdays":[1,3],"timeOfDay":"09:00","useLatest":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"messageId":{"type":["string","null"]},"title":{"type":["string","null"]},"kind":{"type":"string","enum":["once","recurring"]},"runAt":{"type":["string","null"]},"weekdays":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeOfDay":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"nextRuns":{"type":"array","items":{"type":"string"}},"state":{"type":"string"},"target":{},"speed":{"type":"string"},"useLatest":{"type":"boolean"},"version":{"type":"number"},"lastRunAt":{"type":["string","null"]},"lastJobIds":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["id","messageId","title","kind","runAt","weekdays","timeOfDay","nextRunAt","nextRuns","state","target","speed","useLatest","version","lastRunAt","lastJobIds","warnings"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedule_update":{"post":{"operationId":"groups.schedule_update","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedule_update.md"},"x-mcp-tool":"groups_schedule_update","x-cli":"node cli/atomiks.mjs groups.schedule_update --json '{...}'","x-session-only":false,"summary":"Editar um agendamento","description":"Edita no lugar um agendamento `scheduled` ou `paused` (sobe `version` e recalcula o próximo disparo). Informar `messageId` (mesmo o atual) congela de novo a versão atual da mensagem. O tipo (`once`/`recurring`) não muda: crie outro agendamento. Se outra pessoa editou antes, responde `invalid_input`.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"messageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"target":{"anyOf":[{"type":"object","properties":{"all":{"type":"boolean","const":true}},"required":["all"],"additionalProperties":false},{"type":"object","properties":{"folderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["folderId"],"additionalProperties":false},{"type":"object","properties":{"linkId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["linkId"],"additionalProperties":false},{"type":"object","properties":{"groupIds":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["groupIds"],"additionalProperties":false}]},"speed":{"type":"string","enum":["slow","normal","fast"]},"runAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"useLatest":{"type":"boolean"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001","timeOfDay":"10:00"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"messageId":{"type":["string","null"]},"title":{"type":["string","null"]},"kind":{"type":"string","enum":["once","recurring"]},"runAt":{"type":["string","null"]},"weekdays":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeOfDay":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"nextRuns":{"type":"array","items":{"type":"string"}},"state":{"type":"string"},"target":{},"speed":{"type":"string"},"useLatest":{"type":"boolean"},"version":{"type":"number"},"lastRunAt":{"type":["string","null"]},"lastJobIds":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["id","messageId","title","kind","runAt","weekdays","timeOfDay","nextRunAt","nextRuns","state","target","speed","useLatest","version","lastRunAt","lastJobIds","warnings"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedule_pause":{"post":{"operationId":"groups.schedule_pause","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedule_pause.md"},"x-mcp-tool":"groups_schedule_pause","x-cli":"node cli/atomiks.mjs groups.schedule_pause --json '{...}'","x-session-only":false,"summary":"Pausar um agendamento","description":"Pausa um agendamento `scheduled`: nada sai até retomar.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"}},"required":["id","state"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedule_resume":{"post":{"operationId":"groups.schedule_resume","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedule_resume.md"},"x-mcp-tool":"groups_schedule_resume","x-cli":"node cli/atomiks.mjs groups.schedule_resume --json '{...}'","x-session-only":false,"summary":"Retomar um agendamento pausado","description":"Volta um agendamento `paused` para `scheduled` e recalcula o próximo disparo. Envio único cujo horário já passou responde `invalid_input` (edite a data antes).","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"}},"required":["id","state"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.schedule_cancel":{"post":{"operationId":"groups.schedule_cancel","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.schedule_cancel.md"},"x-mcp-tool":"groups_schedule_cancel","x-cli":"node cli/atomiks.mjs groups.schedule_cancel --json '{...}'","x-session-only":false,"summary":"Cancelar um agendamento","description":"Cancela um agendamento `scheduled` ou `paused`. O que já foi enviado não muda.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id"]},"example":{"id":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"}},"required":["id","state"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.sends_list":{"post":{"operationId":"groups.sends_list","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.sends_list.md"},"x-mcp-tool":"groups_sends_list","x-cli":"node cli/atomiks.mjs groups.sends_list --json '{...}'","x-session-only":false,"summary":"Listar os disparos da campanha","description":"Jobs de enviar, apagar e editar mensagem, do mais novo ao mais antigo, com progresso, título da mensagem e agendamento de origem (`scheduleId`). Apagar e editar trazem o disparo original em `sourceJobId`. Disparos de boas-vindas (`isWelcome`) ficam de fora, a menos que `includeWelcome` seja verdadeiro.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"limit":{"default":20,"type":"integer","minimum":1,"maximum":50},"includeWelcome":{"default":false,"type":"boolean"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","limit":20,"includeWelcome":false}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"nextAt":{"type":["string","null"]},"lastReason":{"type":["string","null"]},"createdAt":{"type":"string"},"isWelcome":{"type":"boolean"},"title":{"type":["string","null"]},"messageKind":{"anyOf":[{"type":"string","enum":["text","media","link","poll","contact"]},{"type":"null"}]},"scheduleId":{"type":["string","null"]},"sourceJobId":{"type":["string","null"]}},"required":["id","kind","status","total","done","failed","nextAt","lastReason","createdAt","isWelcome","title","messageKind","scheduleId","sourceJobId"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.send_items":{"post":{"operationId":"groups.send_items","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.send_items.md"},"x-mcp-tool":"groups_send_items","x-cli":"node cli/atomiks.mjs groups.send_items --json '{...}'","x-session-only":false,"summary":"Ver os itens de um disparo, por grupo","description":"Os primeiros 500 itens do disparo (posição, grupo, estado `pending`/`done`/`failed`/`skipped`, motivo da falha já traduzido e `waMessageId` quando enviado). `status` filtra.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","done","failed","skipped"]}},"required":["jobId"]},"example":{"jobId":"00000000-0000-4000-8000-000000000001","status":"failed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"groupId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":"string"},"error":{"type":["string","null"]},"waMessageId":{"type":["string","null"]}},"required":["position","groupId","name","status","error","waMessageId"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.send_retry_failed":{"post":{"operationId":"groups.send_retry_failed","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.send_retry_failed.md"},"x-mcp-tool":"groups_send_retry_failed","x-cli":"node cli/atomiks.mjs groups.send_retry_failed --json '{...}'","x-session-only":false,"summary":"Reenviar só o que falhou em um disparo","description":"Cria um job novo só com os itens `failed` do disparo (mesmo conteúdo, mesmo número). Os já enviados não repetem. Sem falhas, ou se o reenvio já foi criado, responde `invalid_input`; para tentar de novo outra rodada, use o job do reenvio.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["jobId"]},"example":{"jobId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"total":{"type":"number"}},"required":["jobId","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.send_delete":{"post":{"operationId":"groups.send_delete","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.send_delete.md"},"x-mcp-tool":"groups_send_delete","x-cli":"node cli/atomiks.mjs groups.send_delete --json '{...}'","x-session-only":false,"summary":"Apagar para todos o que um disparo entregou","description":"Cria um job `delete_message` com os itens `done` que têm `waMessageId` e saíram há menos de 48 h. O disparo precisa estar parado (`queued`/`running` responde `invalid_input`; `canceled` vale). Também responde `invalid_input` se nada foi entregue, nada está na janela ou o disparo já foi apagado.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["jobId"]},"example":{"jobId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"total":{"type":"number"}},"required":["jobId","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.send_edit":{"post":{"operationId":"groups.send_edit","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.send_edit.md"},"x-mcp-tool":"groups_send_edit","x-cli":"node cli/atomiks.mjs groups.send_edit --json '{...}'","x-session-only":false,"summary":"Editar o texto do que um disparo entregou","description":"Cria um job `edit_message` que troca o texto nos itens `done` com `waMessageId` enviados há menos de 15 min. O disparo precisa estar parado (`queued`/`running` responde `invalid_input`; `canceled` vale). Só vale para disparo de `text` ou `link` (mídia, enquete e contato não editam). Texto de até 4.096 caracteres, sem variação.","x-scope":"marketing:write","x-access":"admin","x-mutates":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["jobId","text"]},"example":{"jobId":"00000000-0000-4000-8000-000000000001","text":"Texto corrigido"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"jobId":{"type":"string"},"total":{"type":"number"}},"required":["jobId","total"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.membership_stats":{"post":{"operationId":"groups.membership_stats","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.membership_stats.md"},"x-mcp-tool":"groups_membership_stats","x-cli":"node cli/atomiks.mjs groups.membership_stats --json '{...}'","x-session-only":false,"summary":"Entradas e saídas da campanha por período","description":"Entradas, saídas e saldo no período (`from`/`to` em ISO 8601, no máximo 90 dias), por `hour` ou `day` no fuso da campanha: `{series: [{at, joins, leaves, net}], byGroup: [{groupId, name, joins, leaves, net, memberCount}], totals: {joins, leaves, net, leaveRate}}`.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"bucket":{"type":"string","enum":["hour","day"]}},"required":["campaignId","from","to","bucket"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001","from":"2026-10-19T00:00:00Z","to":"2026-10-26T00:00:00Z","bucket":"day"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaign_health":{"post":{"operationId":"groups.campaign_health","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaign_health.md"},"x-mcp-tool":"groups_campaign_health","x-cli":"node cli/atomiks.mjs groups.campaign_health --json '{...}'","x-session-only":false,"summary":"Saúde da campanha de grupos","description":"Nota de 0 a 100, nível (`ok`, `attention`, `critical`), os motivos em português e a próxima ação (`nextAction`: rótulo e aba onde resolver). Considera números, grupos, alertas abertos e a última entrada.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"campaignId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["campaignId"]},"example":{"campaignId":"00000000-0000-4000-8000-000000000001"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"score":{"type":"number"},"level":{"type":"string","enum":["ok","attention","critical"]},"reasons":{"type":"array","items":{"type":"string"}},"nextAction":{"type":"object","properties":{"label":{"type":"string"},"tab":{"anyOf":[{"type":"string","enum":["groups","capture","messages","settings"]},{"type":"null"}]}},"required":["label","tab"],"additionalProperties":false}},"required":["score","level","reasons","nextAction"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/groups.campaigns_health":{"post":{"operationId":"groups.campaigns_health","tags":["groups"],"externalDocs":{"description":"Página da operação em Markdown","url":"/docs/operacoes/groups.campaigns_health.md"},"x-mcp-tool":"groups_campaigns_health","x-cli":"node cli/atomiks.mjs groups.campaigns_health --json '{...}'","x-session-only":false,"summary":"Saúde de todas as campanhas de grupos","description":"Para a lista de campanhas: `items` com `campaignId`, `score`, `level` e `nextAction` de cada campanha não encerrada.","x-scope":"marketing:read","x-access":"member","x-mutates":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"score":{"type":"number"},"level":{"type":"string","enum":["ok","attention","critical"]},"nextAction":{"type":"object","properties":{"label":{"type":"string"},"tab":{"anyOf":[{"type":"string","enum":["groups","capture","messages","settings"]},{"type":"null"}]}},"required":["label","tab"],"additionalProperties":false},"campaignId":{"type":"string"}},"required":["score","level","nextAction","campaignId"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}},"400":{"description":"invalid_input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"forbidden, account_pending ou scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"securitySchemes":{"bearerKey":{"type":"http","scheme":"bearer","description":"Chave de API: atk_..."},"session":{"type":"apiKey","in":"cookie","name":"sb-access-token","description":"Sessão da interface"}}}}