> ## 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.

# Create a WABA message template

> Submit a new message template to Meta for review. `name` must be lowercase snake_case; `category` is MARKETING, UTILITY or AUTHENTICATION; `language` is a Meta language code (e.g. pt_BR). Body placeholders use {{1}}, {{2}}… and `bodyExample` supplies a sample value per placeholder.

Headers: set `headerFormat` to TEXT (with `headerText`) or IMAGE/VIDEO/DOCUMENT (with `headerMediaUrl` or `headerMediaBase64` — the sample is uploaded to Meta automatically). Buttons: pass `buttons[]` with QUICK_REPLY (`text`), URL (`text`, `url` — add `urlExample` when the url has {{1}}), PHONE_NUMBER (`text`, `phoneNumber`) or COPY_CODE (`example`). `data` carries the created template id + initial status (usually PENDING).



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/connections/cloud-api/{id}/templates
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/{id}/templates:
    post:
      tags:
        - Cloud API
      summary: Create a WABA message template
      description: >-
        Submit a new message template to Meta for review. `name` must be
        lowercase snake_case; `category` is MARKETING, UTILITY or
        AUTHENTICATION; `language` is a Meta language code (e.g. pt_BR). Body
        placeholders use {{1}}, {{2}}… and `bodyExample` supplies a sample value
        per placeholder.


        Headers: set `headerFormat` to TEXT (with `headerText`) or
        IMAGE/VIDEO/DOCUMENT (with `headerMediaUrl` or `headerMediaBase64` — the
        sample is uploaded to Meta automatically). Buttons: pass `buttons[]`
        with QUICK_REPLY (`text`), URL (`text`, `url` — add `urlExample` when
        the url has {{1}}), PHONE_NUMBER (`text`, `phoneNumber`) or COPY_CODE
        (`example`). `data` carries the created template id + initial status
        (usually PENDING).
      operationId: postApiV1ConnectionsCloud-apiByIdTemplates
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  minLength: 1
                  pattern: ^[a-z0-9_]+$
                  type: string
                category:
                  anyOf:
                    - const: MARKETING
                      type: string
                    - const: UTILITY
                      type: string
                    - const: AUTHENTICATION
                      type: string
                language:
                  minLength: 2
                  type: string
                headerFormat:
                  anyOf:
                    - const: TEXT
                      type: string
                    - const: IMAGE
                      type: string
                    - const: VIDEO
                      type: string
                    - const: DOCUMENT
                      type: string
                headerText:
                  type: string
                headerMediaUrl:
                  type: string
                headerMediaBase64:
                  type: string
                headerMediaMime:
                  type: string
                bodyText:
                  minLength: 1
                  type: string
                footerText:
                  type: string
                bodyExample:
                  type: array
                  items:
                    type: string
                buttons:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - const: QUICK_REPLY
                            type: string
                          - const: URL
                            type: string
                          - const: PHONE_NUMBER
                            type: string
                          - const: COPY_CODE
                            type: string
                      text:
                        type: string
                      url:
                        type: string
                      urlExample:
                        type: string
                      phoneNumber:
                        type: string
                      example:
                        type: string
                    required:
                      - type
              required:
                - name
                - category
                - language
                - bodyText
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  minLength: 1
                  pattern: ^[a-z0-9_]+$
                  type: string
                category:
                  anyOf:
                    - const: MARKETING
                      type: string
                    - const: UTILITY
                      type: string
                    - const: AUTHENTICATION
                      type: string
                language:
                  minLength: 2
                  type: string
                headerFormat:
                  anyOf:
                    - const: TEXT
                      type: string
                    - const: IMAGE
                      type: string
                    - const: VIDEO
                      type: string
                    - const: DOCUMENT
                      type: string
                headerText:
                  type: string
                headerMediaUrl:
                  type: string
                headerMediaBase64:
                  type: string
                headerMediaMime:
                  type: string
                bodyText:
                  minLength: 1
                  type: string
                footerText:
                  type: string
                bodyExample:
                  type: array
                  items:
                    type: string
                buttons:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - const: QUICK_REPLY
                            type: string
                          - const: URL
                            type: string
                          - const: PHONE_NUMBER
                            type: string
                          - const: COPY_CODE
                            type: string
                      text:
                        type: string
                      url:
                        type: string
                      urlExample:
                        type: string
                      phoneNumber:
                        type: string
                      example:
                        type: string
                    required:
                      - type
              required:
                - name
                - category
                - language
                - bodyText
          text/plain:
            schema:
              type: object
              properties:
                name:
                  minLength: 1
                  pattern: ^[a-z0-9_]+$
                  type: string
                category:
                  anyOf:
                    - const: MARKETING
                      type: string
                    - const: UTILITY
                      type: string
                    - const: AUTHENTICATION
                      type: string
                language:
                  minLength: 2
                  type: string
                headerFormat:
                  anyOf:
                    - const: TEXT
                      type: string
                    - const: IMAGE
                      type: string
                    - const: VIDEO
                      type: string
                    - const: DOCUMENT
                      type: string
                headerText:
                  type: string
                headerMediaUrl:
                  type: string
                headerMediaBase64:
                  type: string
                headerMediaMime:
                  type: string
                bodyText:
                  minLength: 1
                  type: string
                footerText:
                  type: string
                bodyExample:
                  type: array
                  items:
                    type: string
                buttons:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - const: QUICK_REPLY
                            type: string
                          - const: URL
                            type: string
                          - const: PHONE_NUMBER
                            type: string
                          - const: COPY_CODE
                            type: string
                      text:
                        type: string
                      url:
                        type: string
                      urlExample:
                        type: string
                      phoneNumber:
                        type: string
                      example:
                        type: string
                    required:
                      - type
              required:
                - name
                - category
                - language
                - bodyText
      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>'

````