> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hubfy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Editar rascunho da página

> Edita seções, textos e aparência do rascunho de uma página (versão A). POST /v1/pages/{page_id}/draft na API da Hubfy: parâmetros, resposta, erros e exemplos. Também no conector MCP (save_page_draft).



## OpenAPI

````yaml api/v1/openapi.yaml POST /v1/pages/{page_id}/draft
openapi: 3.1.0
info:
  title: API da Hubfy
  version: v1
  description: >-
    A API REST da Hubfy: as mesmas operações do conector MCP, chamadas com uma
    chave de API em nome de quem a criou. Gerada do catálogo de operações; veja
    https://docs.hubfy.io/api-reference/introduction.
  contact:
    name: Hubfy
    url: https://hubfy.io
servers:
  - url: https://api.hubfy.io
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: Conta e busca
    description: >-
      Respondem em toda conexão, qualquer que seja a área liberada: a conta
      conectada, a busca geral e a abertura de um item pelo id.
  - name: Início
    description: >-
      Os indicadores da página inicial da conta: vendas, alunos e o resumo do
      período.
  - name: Pedidos
    description: >-
      Vendas, pedidos, assinaturas, a análise de vendas e os checkouts
      abandonados.
  - name: Clientes
    description: >-
      Contatos e alunos: cadastro, linha do tempo, tags, notas, campos
      personalizados e acessos liberados.
  - name: Suporte
    description: 'Os atendimentos dos alunos: caixa de entrada, conversa e respostas.'
  - name: Produtos e checkouts
    description: Produtos, ofertas, checkouts, cupons e ofertas pós-compra.
  - name: Email
    description: Envios por e-mail e sino, modelos, listas de contatos e e-mails de teste.
  - name: Formulários
    description: Formulários de captação e as respostas recebidas.
  - name: Páginas
    description: Páginas de venda e captação, com as métricas de visita e conversão.
  - name: Campanhas
    description: >-
      Gasto e resultado das campanhas da Meta, do TikTok e do Google, com o
      Foco, os grupos e as UTMs.
  - name: Arquivos
    description: >-
      A biblioteca de arquivos e vídeos, com pastas, legendas, áudios, capas e
      métricas de vídeo.
  - name: Cursos
    description: Cursos, módulos, aulas, matrículas e o progresso dos alunos.
  - name: Vitrines
    description: As vitrines da área de membros, com seções e itens.
  - name: Mentorias
    description: Mentorias, encontros, tarefas, materiais e anotações.
  - name: Comunidades
    description: >-
      Comunidades, espaços, publicações e membros, com a moderação de
      comentários e denúncias.
  - name: Eventos
    description: Eventos, sessões, ingressos e participantes.
  - name: Configurações
    description: Dados da conta, aparência, modelos de e-mail e a equipe.
  - name: Integrações
    description: >-
      Plataformas conectadas, eventos recebidos dos gateways, mapeamentos de
      produto, destinos de rastreamento e entregas de webhook.
paths:
  /v1/pages/{page_id}/draft:
    post:
      tags:
        - Páginas
      summary: Editar rascunho da página
      description: >-
        Edita seções, textos e aparência do rascunho de uma página (versão A).
        Leia antes com `GET /v1/pages/{page_id}` (sections e draft_revision).
        Por padrão (mode upsert) envie só as seções que mudam, com o id de cada
        uma (a seção inteira é substituída), e use remove_section_ids e order;
        mode replace troca a página inteira. Cada seção é { id?, type, variant?,
        tone?, reveal?, data }. Tipos: header, hero, video, proof, benefits,
        audience, curriculum, author, testimonials, pricing, guarantee, faq,
        countdown, form, cta, text, footer, stickybar (header, footer e
        stickybar uma vez só). Uma página de vendas completa costuma ter:
        header, hero, video (opcional), benefits, audience, curriculum (com
        course_id), author, testimonials, pricing (com price_id e botão kind
        checkout → chk_…), guarantee, faq, cta e footer. Botões: { label, kind,
        target }; o botão de compra usa kind "checkout" e o id do checkout. Se a
        página estiver no ar, ela só muda ao publicar de novo (`POST
        /v1/pages/{page_id}/publish`). Para a versão B de um teste A/B use `POST
        /v1/pages/{page_id}/experiment`.


        **Permissão:** Área **Páginas** em **Ver e alterar**.

        **No conector MCP:** `save_page_draft`.
      operationId: save_page_draft
      parameters:
        - name: page_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^pag_[a-z0-9]{16}$
            examples:
              - pag_4f8k2m9q1x7c3v5b
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            maxLength: 255
          description: >-
            Chave única desta alteração (ex.: um UUID). Repetir a chamada com a
            mesma chave devolve a mesma resposta, sem duplicar.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                revision:
                  description: >-
                    draft_revision lido em get_page. Envie para não sobrescrever
                    uma edição feita no painel depois da sua leitura.
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                mode:
                  default: upsert
                  description: >-
                    upsert (padrão): cada seção de sections com id existente
                    substitui aquela seção inteira no lugar; id novo ou omitido
                    acrescenta antes do rodapé. replace: sections vira a página
                    inteira, na ordem dada.
                  type: string
                  enum:
                    - upsert
                    - replace
                sections:
                  description: Seções a gravar, conforme mode.
                  maxItems: 50
                  type: array
                  items:
                    $ref: '#/components/schemas/HubfyPageSection'
                remove_section_ids:
                  description: Ids das seções a retirar (mode upsert).
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9_-]{1,40}$
                order:
                  description: >-
                    Nova ordem pelos ids (mode upsert); as não citadas vão para
                    o fim.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9_-]{1,40}$
                theme:
                  type: object
                  properties:
                    scheme:
                      type: string
                      enum:
                        - light
                        - dark
                    accent:
                      description: 'Cor dos botões e destaques, ex.: #6d28d9.'
                      type: string
                      pattern: ^#[0-9a-fA-F]{6}$
                    background:
                      description: Fundo da página; vazio segue o esquema.
                      type: string
                      pattern: ^(#[0-9a-fA-F]{6})?$
                    font:
                      description: 'Família do Google Fonts do texto, ex.: Inter.'
                      type: string
                      maxLength: 60
                    heading_font:
                      description: Família dos títulos; vazio usa a do texto.
                      type: string
                      maxLength: 60
                    radius:
                      type: string
                      enum:
                        - none
                        - md
                        - lg
                        - full
                  description: Aparência. Campos omitidos mantêm o valor atual.
              additionalProperties: false
            example:
              revision: 1
              mode: upsert
              sections:
                - null
      responses:
        '200':
          description: Sucesso.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  status:
                    type: string
                  dashboard_url:
                    type: string
                required:
                  - id
                  - name
                  - status
                  - dashboard_url
                additionalProperties: {}
              example:
                id: pag_4f8k2m9q1x7c3v5b
                name: Fotografia Essencial
                status: active
                dashboard_url: https://dashboard.hubfy.io/acc_3h6k9n2q5t8w1z4c/dashboard
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    HubfyPageSection:
      oneOf:
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: header
            variant:
              description: 'Desenho: simple, centered. Padrão: simple.'
              type: string
              enum:
                - simple
                - centered
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                brand:
                  type: string
                  minLength: 1
                  maxLength: 80
                  description: Nome da marca ou do produto.
                logo_file_id:
                  description: Imagem pública da conta (file_…).
                  anyOf:
                    - type: string
                      pattern: ^file_[a-z0-9]{16}$
                      examples:
                        - file_4f8k2m9q1x7c3v5b
                    - type: 'null'
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
              required:
                - brand
          required:
            - type
            - data
          description: Topo com a marca e um botão.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: hero
            variant:
              description: 'Desenho: centered, split, cover. Padrão: centered.'
              type: string
              enum:
                - centered
                - split
                - cover
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                eyebrow:
                  description: 'Texto pequeno acima do título, ex.: "Turma de novembro".'
                  type: string
                  maxLength: 80
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: A promessa principal em uma frase.
                subtitle:
                  type: string
                  maxLength: 600
                bullets:
                  description: Até 8 frases curtas de resultado.
                  maxItems: 8
                  type: array
                  items:
                    type: string
                    maxLength: 160
                image_file_id:
                  description: Imagem pública da conta (file_…).
                  anyOf:
                    - type: string
                      pattern: ^file_[a-z0-9]{16}$
                      examples:
                        - file_4f8k2m9q1x7c3v5b
                    - type: 'null'
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
                cta2:
                  description: Segundo botão, opcional.
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
              required:
                - title
          required:
            - type
            - data
          description: >-
            Abertura da página: a promessa principal. Variações centered, split
            (imagem ao lado) e cover (imagem de fundo).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: video
            variant:
              description: 'Desenho: wide, framed. Padrão: wide.'
              type: string
              enum:
                - wide
                - framed
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                source:
                  anyOf:
                    - anyOf:
                        - type: object
                          properties:
                            kind:
                              type: string
                              const: library
                            asset_id:
                              type: string
                              pattern: ^[a-z]{2,5}_[a-z0-9]{16}$
                              description: Vídeo da biblioteca da conta (Arquivos).
                          required:
                            - kind
                            - asset_id
                        - type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - youtube
                                - vimeo
                                - panda
                            url:
                              type: string
                              maxLength: 500
                              format: uri
                          required:
                            - kind
                            - url
                    - type: 'null'
                  description: >-
                    De onde vem o vídeo. null: ainda não escolhido (impede
                    publicar).
                poster_file_id:
                  description: Imagem pública da conta (file_…).
                  anyOf:
                    - type: string
                      pattern: ^file_[a-z0-9]{16}$
                      examples:
                        - file_4f8k2m9q1x7c3v5b
                    - type: 'null'
                autoplay:
                  type: boolean
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
              required:
                - source
          required:
            - type
            - data
          description: Vídeo de vendas (VSL).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: proof
            variant:
              description: 'Desenho: stats, logos. Padrão: stats.'
              type: string
              enum:
                - stats
                - logos
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                stats:
                  maxItems: 6
                  type: array
                  items:
                    type: object
                    properties:
                      value:
                        type: string
                        minLength: 1
                        maxLength: 40
                        description: 'Ex.: "+2.000".'
                      label:
                        type: string
                        maxLength: 80
                        description: 'Ex.: "alunos".'
                    required:
                      - value
                      - label
                logos:
                  description: Imagens públicas (file_…) de logos.
                  maxItems: 12
                  type: array
                  items:
                    type: string
                    pattern: ^file_[a-z0-9]{16}$
                    examples:
                      - file_4f8k2m9q1x7c3v5b
          required:
            - type
            - data
          description: Prova social em números (stats) ou logos (logos).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: benefits
            variant:
              description: 'Desenho: grid, list, cards. Padrão: grid.'
              type: string
              enum:
                - grid
                - list
                - cards
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                items:
                  minItems: 1
                  maxItems: 30
                  type: array
                  items:
                    type: object
                    properties:
                      icon:
                        description: >-
                          Ícone: sparkles, rocket, shield, star, heart, clock,
                          bolt, target, users, book, trophy, gift, chat, chart.
                        type: string
                        enum:
                          - sparkles
                          - rocket
                          - shield
                          - star
                          - heart
                          - clock
                          - bolt
                          - target
                          - users
                          - book
                          - trophy
                          - gift
                          - chat
                          - chart
                      title:
                        type: string
                        minLength: 1
                        maxLength: 120
                      text:
                        type: string
                        maxLength: 600
                    required:
                      - title
              required:
                - items
          required:
            - type
            - data
          description: 'Benefícios: o que a pessoa conquista.'
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: audience
            variant:
              description: 'Desenho: check, columns. Padrão: check.'
              type: string
              enum:
                - check
                - columns
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                items:
                  minItems: 1
                  maxItems: 30
                  type: array
                  items:
                    type: string
                    maxLength: 200
                not_title:
                  type: string
                  maxLength: 200
                not_items:
                  maxItems: 30
                  type: array
                  items:
                    type: string
                    maxLength: 200
              required:
                - items
          required:
            - type
            - data
          description: Para quem é (e, opcional, para quem não é).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: curriculum
            variant:
              description: 'Desenho: accordion, list. Padrão: accordion.'
              type: string
              enum:
                - accordion
                - list
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                course_id:
                  description: >-
                    Curso da conta (crs_…). Recomendado: a grade fica sempre
                    igual à do curso.
                  anyOf:
                    - type: string
                      pattern: ^crs_[a-z0-9]{16}$
                      examples:
                        - crs_4f8k2m9q1x7c3v5b
                    - type: 'null'
                modules:
                  description: Módulos escritos à mão, usados quando não há course_id.
                  maxItems: 60
                  type: array
                  items:
                    type: object
                    properties:
                      title:
                        type: string
                        minLength: 1
                        maxLength: 200
                      text:
                        type: string
                        maxLength: 600
                    required:
                      - title
          required:
            - type
            - data
          description: >-
            Conteúdo do curso. Com course_id, os módulos e a quantidade de aulas
            vêm do curso real e acompanham as mudanças; sem ele, use modules.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: author
            variant:
              description: 'Desenho: side, centered. Padrão: side.'
              type: string
              enum:
                - side
                - centered
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                role:
                  type: string
                  maxLength: 120
                bio:
                  type: string
                  maxLength: 2000
                photo_file_id:
                  description: Imagem pública da conta (file_…).
                  anyOf:
                    - type: string
                      pattern: ^file_[a-z0-9]{16}$
                      examples:
                        - file_4f8k2m9q1x7c3v5b
                    - type: 'null'
              required:
                - name
          required:
            - type
            - data
          description: Quem ensina.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: testimonials
            variant:
              description: 'Desenho: cards, wall, highlight. Padrão: cards.'
              type: string
              enum:
                - cards
                - wall
                - highlight
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                items:
                  minItems: 1
                  maxItems: 30
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                      role:
                        type: string
                        maxLength: 120
                      text:
                        type: string
                        minLength: 1
                        maxLength: 1500
                      photo_file_id:
                        description: Imagem pública da conta (file_…).
                        anyOf:
                          - type: string
                            pattern: ^file_[a-z0-9]{16}$
                            examples:
                              - file_4f8k2m9q1x7c3v5b
                          - type: 'null'
                      image_file_id:
                        description: Print ou imagem do depoimento, opcional.
                        anyOf:
                          - type: string
                            pattern: ^file_[a-z0-9]{16}$
                            examples:
                              - file_4f8k2m9q1x7c3v5b
                          - type: 'null'
                    required:
                      - name
                      - text
              required:
                - items
          required:
            - type
            - data
          description: >-
            Depoimentos de alunos. Use apenas depoimentos reais fornecidos pela
            pessoa.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: pricing
            variant:
              description: 'Desenho: single, columns. Padrão: single.'
              type: string
              enum:
                - single
                - columns
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                plans:
                  minItems: 1
                  maxItems: 4
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                      price_id:
                        description: >-
                          Oferta do produto (prc_…, de get_product).
                          Recomendado.
                        anyOf:
                          - type: string
                            pattern: ^prc_[a-z0-9]{16}$
                            examples:
                              - prc_4f8k2m9q1x7c3v5b
                          - type: 'null'
                      price_text:
                        description: 'Preço escrito, ex.: "R$ 497" (usado sem price_id).'
                        type: string
                        maxLength: 60
                      compare_text:
                        description: 'Preço riscado, ex.: "R$ 997".'
                        type: string
                        maxLength: 60
                      note:
                        description: 'Ex.: "ou 12x de R$ 49,70".'
                        type: string
                        maxLength: 200
                      features:
                        maxItems: 20
                        type: array
                        items:
                          type: string
                          maxLength: 200
                      badge:
                        description: 'Selo, ex.: "Mais vendido".'
                        type: string
                        maxLength: 40
                      highlight:
                        type: boolean
                      cta:
                        anyOf:
                          - $ref: '#/components/schemas/HubfyPageButton'
                          - type: 'null'
                    required:
                      - name
              required:
                - plans
          required:
            - type
            - data
          description: >-
            Preço e chamada para compra. Com price_id, o valor e o parcelamento
            vêm da oferta real; os textos viram reserva. O botão de cada plano
            deve ir ao checkout (kind checkout).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: guarantee
            variant:
              description: 'Desenho: badge, banner. Padrão: badge.'
              type: string
              enum:
                - badge
                - banner
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                text:
                  type: string
                  maxLength: 1000
                days:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 365
                    - type: 'null'
              required:
                - title
          required:
            - type
            - data
          description: Garantia.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: faq
            variant:
              description: 'Desenho: accordion, columns. Padrão: accordion.'
              type: string
              enum:
                - accordion
                - columns
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                items:
                  minItems: 1
                  maxItems: 30
                  type: array
                  items:
                    type: object
                    properties:
                      q:
                        type: string
                        minLength: 1
                        maxLength: 300
                      a:
                        type: string
                        minLength: 1
                        maxLength: 2000
                    required:
                      - q
                      - a
              required:
                - items
          required:
            - type
            - data
          description: Perguntas frequentes.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: countdown
            variant:
              description: 'Desenho: bar, card. Padrão: bar.'
              type: string
              enum:
                - bar
                - card
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                mode:
                  type: string
                  enum:
                    - fixed
                    - visitor
                  description: >-
                    fixed: termina em ends_at para todos; visitor: `minutes` a
                    partir da primeira visita de cada pessoa.
                ends_at:
                  description: Fim, em ISO 8601 com fuso (modo fixed).
                  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'
                minutes:
                  anyOf:
                    - type: integer
                      minimum: 1
                      maximum: 100000
                    - type: 'null'
                expire:
                  default:
                    action: none
                  type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - none
                        - hide
                        - redirect
                        - show
                      description: >-
                        Ao acabar: nada, esconder a contagem, ir para url, ou
                        mostrar a seção section_id.
                    url:
                      type: string
                      maxLength: 500
                    section_id:
                      type: string
                      pattern: ^[A-Za-z0-9_-]{1,40}$
                  required:
                    - action
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
              required:
                - mode
          required:
            - type
            - data
          description: Contagem regressiva.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: form
            variant:
              description: 'Desenho: card, split. Padrão: card.'
              type: string
              enum:
                - card
                - split
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                form_id:
                  anyOf:
                    - type: string
                      pattern: ^frm_[a-z0-9]{16}$
                      examples:
                        - frm_4f8k2m9q1x7c3v5b
                    - type: 'null'
                  description: Formulário da conta (frm_…). null impede publicar.
                after:
                  default:
                    kind: message
                    title: Recebemos seus dados
                  description: O que acontece depois do envio.
                  anyOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: message
                        title:
                          type: string
                          maxLength: 200
                        text:
                          type: string
                          maxLength: 1000
                      required:
                        - kind
                    - type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - checkout
                            - link
                            - whatsapp
                        target:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: chk_…, URL ou telefone com DDI.
                      required:
                        - kind
                        - target
              required:
                - form_id
          required:
            - type
            - data
          description: >-
            Formulário de captação (páginas de objetivo lead). O formulário
            precisa estar publicado e público (Formulários).
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: cta
            variant:
              description: 'Desenho: centered, banner. Padrão: centered.'
              type: string
              enum:
                - centered
                - banner
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                subtitle:
                  type: string
                  maxLength: 600
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
              required:
                - title
          required:
            - type
            - data
          description: Chamada para ação.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: text
            variant:
              description: 'Desenho: default, narrow. Padrão: default.'
              type: string
              enum:
                - default
                - narrow
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                body:
                  type: string
                  minLength: 1
                  maxLength: 20000
                  description: Texto simples; linhas em branco separam parágrafos.
              required:
                - body
          required:
            - type
            - data
          description: Texto livre.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: footer
            variant:
              description: 'Desenho: simple. Padrão: simple.'
              type: string
              enum:
                - simple
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                text:
                  type: string
                  maxLength: 300
                links:
                  maxItems: 10
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        minLength: 1
                        maxLength: 80
                      url:
                        type: string
                        minLength: 1
                        maxLength: 500
                    required:
                      - label
                      - url
          required:
            - type
            - data
          description: Rodapé.
        - type: object
          properties:
            id:
              description: Único na página; omita em seção nova, mantenha ao editar.
              type: string
              pattern: ^[A-Za-z0-9_-]{1,40}$
            type:
              type: string
              const: stickybar
            variant:
              description: 'Desenho: bottom. Padrão: bottom.'
              type: string
              enum:
                - bottom
            tone:
              description: Fundo da faixa.
              type: string
              enum:
                - default
                - alt
                - accent
                - inverse
            reveal:
              anyOf:
                - $ref: '#/components/schemas/HubfyPageReveal'
                - type: 'null'
            data:
              type: object
              properties:
                text:
                  type: string
                  maxLength: 200
                cta:
                  anyOf:
                    - $ref: '#/components/schemas/HubfyPageButton'
                    - type: 'null'
          required:
            - type
            - data
          description: Barra fixa no rodapé da tela, com um botão.
      id: HubfyPageSection
      description: >-
        Seção da página: { id?, type, variant?, tone?, reveal?, data }; data
        depende de type.
    HubfyPageReveal:
      type: object
      properties:
        mode:
          type: string
          enum:
            - video
            - load
          description: >-
            video: aparece quando o visitante assistiu `seconds` do vídeo da
            página; load: `seconds` depois de abrir a página.
        seconds:
          type: integer
          minimum: 0
          maximum: 36000
        first_visit_only:
          default: true
          description: 'true: quem volta à página já vê a seção.'
          type: boolean
      required:
        - mode
        - seconds
      id: HubfyPageReveal
      description: >-
        Esconde a seção até um ponto do vídeo ou alguns segundos (comum na VSL:
        a oferta aparece quando o vídeo a apresenta).
    HubfyPageButton:
      type: object
      properties:
        id:
          description: >-
            Id do botão dentro da página. Omita em botão novo: o servidor gera.
            Mantenha o id ao editar, para a análise de cliques continuar.
          type: string
          pattern: ^[A-Za-z0-9_-]{1,40}$
        label:
          type: string
          minLength: 1
          maxLength: 80
          description: 'Texto do botão, ex.: "Quero comprar agora".'
        kind:
          type: string
          enum:
            - section
            - form
            - checkout
            - link
            - whatsapp
          description: >-
            Destino do botão: checkout (página de pagamento da Hubfy: target =
            id chk_… de list_checkouts; é o botão de compra da página de
            vendas), section (rola até uma seção desta página: target = id da
            seção, ex.: "form" ou "oferta"), form (abre um formulário publicado:
            target = frm_…), link (target = URL https://…) ou whatsapp (target =
            telefone com DDI, ex.: +5511999998888).
        target:
          default: ''
          description: >-
            Destino conforme kind. Vazio deixa o botão sem destino: salva, mas
            impede publicar.
          type: string
          maxLength: 500
      required:
        - label
        - kind
      id: HubfyPageButton
      description: Botão com destino (label, kind, target).
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - type
          properties:
            code:
              type: string
              description: >-
                Código estável, para o seu código decidir (ex.:
                `insufficient_permission`).
            message:
              type: string
              description: Explicação para pessoas; pode mudar.
            param:
              type:
                - string
                - 'null'
              description: Campo da entrada que causou o erro, quando houver.
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
            doc_url:
              type:
                - string
                - 'null'
  responses:
    BadRequest:
      description: Entrada inválida ou regra recusada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_parameter
              message: 'email: Invalid email address'
              param: null
              type: invalid_request_error
              doc_url: null
    Unauthorized:
      description: Chave ausente, inválida, revogada ou de quem saiu da equipe.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_api_key
              message: Invalid API key
              param: null
              type: authentication_error
              doc_url: null
    Forbidden:
      description: A chave não tem a área, o nível ou Publicar e enviar.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: insufficient_permission
              message: Esta credencial não tem a área orders em Ver e alterar.
              param: null
              type: permission_error
              doc_url: null
    NotFound:
      description: Item inexistente nesta conta.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Pedido ord_4f8k2m9q1x7c3v5b não encontrado nesta conta.
              param: null
              type: invalid_request_error
              doc_url: null
    Conflict:
      description: Outra chamada com a mesma Idempotency-Key ainda está em andamento.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: idempotency_key_in_use
              message: Outra chamada com esta idempotency_key está em andamento.
              param: null
              type: invalid_request_error
              doc_url: null
    RateLimited:
      description: Mais de 300 chamadas por minuto na conta. Espere o tempo de Retry-After.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limit_exceeded
              message: Account request limit exceeded; retry after 60 seconds
              param: null
              type: rate_limit_error
              doc_url: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_live_…
      description: >-
        Chave criada em Meu Perfil → API Keys. Envie `Authorization: Bearer
        sk_live_…`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.