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

# Criar conexão manualmente

> Conecte um número da API Oficial (Cloud API) informando WABA, número e token da Meta.

Cria uma conexão **WhatsApp API Oficial** a partir de credenciais geradas no
Meta Business Manager: o id da WhatsApp Business Account (`wabaId`), o id do
número (`phoneNumberId`) e um `accessToken`.

O backend valida o par (número, token) na Graph API, tenta assinar os webhooks
do app (best-effort) e então provisiona a conexão e sincroniza a cobrança do
plano Scale.

* `webhookMode` — `normalized` (eventos canônicos D-API) ou `meta_passthrough`
  (payloads crus da Meta). Padrão: `normalized`.
* `data.webhookSubscribed` — quando `false`, mostre ao usuário as instruções
  para assinar o webhook manualmente no painel da Meta.

<Warning>
  Requer uma assinatura ativa. Sem assinatura, a resposta é `402` com
  `code: "TRIAL_REQUIRED"` — direcione o usuário ao checkout do plano Scale.
</Warning>

<Tip>
  Para o fluxo guiado via Embedded Signup (SDK), use o assistente de integração
  em vez do cadastro manual de token.
</Tip>


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/connections/cloud-api/manual
openapi: 3.1.0
info:
  title: D-API - Infraestrutura WhatsApp Completa
  description: >-
    Solução escalável e robusta para gestores de automação, SaaS e usuários
    finais que precisam de uma integração WhatsApp confiável. Oferece múltiplas
    instâncias simultâneas, webhooks em tempo real, dashboard intuitivo e API
    REST documentada com 99.9% de uptime e latência inferior a 30ms.
  version: 1.2.1
  contact:
    name: Suporte D-API
    email: suporte@d-api.cloud
    url: https://d-api.cloud
servers:
  - url: https://api.d-api.cloud
    description: Produção
security:
  - ApiKeyAuth: []
tags:
  - name: Início
    description: Endpoints base
  - name: Sessões
    description: Endpoints para gerenciamento de sessões
  - name: Mensagens
    description: Endpoints para envio de mensagens
  - name: Cloud API
    description: >-
      WhatsApp API Oficial (Meta Cloud API): conexão manual, gestão de templates
      (listar/criar/excluir) e envio de templates.
  - name: Ligações URA
    description: >-
      Disparo de ligações de voz (URA): individual ou em massa, com áudio ou
      fluxo IVR.
  - name: SMS
    description: 'Envio de SMS: individual ou em massa.'
paths:
  /api/v1/connections/cloud-api/manual:
    post:
      tags:
        - Cloud API
      summary: Create a cloud_api connection manually
      description: >-
        Create a WhatsApp API Oficial connection from a manually-provided WABA
        id, phone number id and access token (generated in Meta Business
        Manager). Validates the (number, token) pair against the Graph API,
        best-effort subscribes the app for webhooks, then provisions the
        connection and syncs Scale billing. `data` is `{ session,
        webhookSubscribed }` — show manual-subscribe instructions when
        `webhookSubscribed` is false. Returns 402 (code TRIAL_REQUIRED) when the
        user has no active subscription.
      operationId: postApiV1ConnectionsCloud-apiManual
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                wabaId:
                  minLength: 1
                  type: string
                phoneNumberId:
                  minLength: 1
                  type: string
                accessToken:
                  minLength: 1
                  type: string
                businessId:
                  type: string
                webhookMode:
                  anyOf:
                    - const: normalized
                      type: string
                    - const: meta_passthrough
                      type: string
              required:
                - wabaId
                - phoneNumberId
                - accessToken
          multipart/form-data:
            schema:
              type: object
              properties:
                wabaId:
                  minLength: 1
                  type: string
                phoneNumberId:
                  minLength: 1
                  type: string
                accessToken:
                  minLength: 1
                  type: string
                businessId:
                  type: string
                webhookMode:
                  anyOf:
                    - const: normalized
                      type: string
                    - const: meta_passthrough
                      type: string
              required:
                - wabaId
                - phoneNumberId
                - accessToken
          text/plain:
            schema:
              type: object
              properties:
                wabaId:
                  minLength: 1
                  type: string
                phoneNumberId:
                  minLength: 1
                  type: string
                accessToken:
                  minLength: 1
                  type: string
                businessId:
                  type: string
                webhookMode:
                  anyOf:
                    - const: normalized
                      type: string
                    - const: meta_passthrough
                      type: string
              required:
                - wabaId
                - phoneNumberId
                - accessToken
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
            multipart/form-data:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
            text/plain:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
          description: Resposta bem-sucedida
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API Key para autenticação. Formato: <API_KEY>'

````