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

# Enviar plantilla

> Envia um template pelos canais escolhidos (`whatsapp`, `sms`, `email`, …). Respuesta **202**. Escopo conforme o canal.

Para **WhatsApp oficial**, este é o caminho certo (não use `POST /v1/whatsapp/messages` com `type: template`).



## OpenAPI

````yaml /es/template-api/api-reference/openapi-templates.json post /v1/templates/send
openapi: 3.0.3
info:
  title: Notifique API - Templates
  description: >-
    CRUD de templates multicanal e envio. Canais: whatsapp, sms, email,
    telegram, rcs, push, voice. Instagram e Widget nao sao canais de template.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Producao
security:
  - BearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Templates
    description: Templates multicanal e envio
paths:
  /v1/templates/send:
    post:
      tags:
        - Templates
      summary: Enviar plantilla
      description: >-
        Envia um template pelos canais escolhidos (`whatsapp`, `sms`, `email`,
        …). Respuesta **202**. Escopo conforme o canal.


        Para **WhatsApp oficial**, este é o caminho certo (não use `POST
        /v1/whatsapp/messages` com `type: template`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateSendRequest'
            examples:
              whatsappOfficial:
                summary: WhatsApp oficial
                value:
                  template: alerta_pedido
                  channels:
                    - whatsapp
                  to:
                    - '5511999999999'
                  variables:
                    codigo: '12345'
                    name: Maria
                  instanceId: cuid_instancia_whatsapp
              allChannels:
                summary: Todos os canais
                value:
                  template: alerta_pedido
                  channels:
                    - whatsapp
                    - sms
                    - email
                    - telegram
                    - rcs
                    - push
                    - voice
                  to:
                    - '5511999999999'
                    - cliente@email.com
                    - '@usuario_telegram'
                    - cldevice123
                  variables:
                    codigo: '12345'
                    name: Maria
                  instanceId: cuid_instancia_whatsapp
                  from: ola@meudominio.com.br
                  fromName: Equipe Notifique
                  telegram:
                    instanceId: cuid_instancia_telegram
                  push:
                    pushAppId: clapp123
                  voice:
                    from: '+5511400000000'
              smsEmail:
                summary: SMS + e-mail
                value:
                  template: alerta_pedido
                  channels:
                    - sms
                    - email
                  to:
                    - '5511999999999'
                    - cliente@email.com
                  variables:
                    codigo: '12345'
                    name: Maria
                  from: ola@meudominio.com.br
              pushOnly:
                summary: Push
                value:
                  to:
                    - cldevice123
                  template: alerta_push
                  channels:
                    - push
                  push:
                    pushAppId: clapp123
              voiceOtp:
                summary: Voice OTP
                value:
                  to:
                    - '+5511999887766'
                  template: otp_voz
                  channels:
                    - voice
                  variables:
                    code: '482910'
                  voice:
                    from: '+5511400000000'
                    machineDetection: detect
      responses:
        '202':
          description: Aceito para envio
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSendResponse'
              examples:
                allChannels:
                  summary: Todos os canais (IDs por canal)
                  value:
                    success: true
                    data:
                      messageIds:
                        - clmsg_wa1
                      smsIds:
                        - clsms1
                      emailIds:
                        - clemail1
                      telegramIds:
                        - cltg1
                      rcsIds:
                        - clrcs1
                      pushIds:
                        - clpush1
                      voiceCallIds:
                        - clvoice1
                      status: QUEUED
                      count: 7
                smsAndEmail:
                  summary: SMS + e-mail
                  value:
                    success: true
                    data:
                      smsIds:
                        - clsms01abc
                      emailIds:
                        - clemail01xyz
                      status: QUEUED
                      count: 2
                withSmsSkippedAndLocalization:
                  summary: Com SMS pulado e localizacao
                  value:
                    success: true
                    data:
                      smsIds:
                        - clsms_ok
                      emailIds:
                        - clemail_ok
                      status: QUEUED
                      count: 2
                      smsSkippedRecipients:
                        - '5511888777666'
                      localization:
                        appliedAiLocales:
                          - en
                          - es
                        fallbackLocales:
                          - pt
                        aiTranslationLocaleCount: 2
                sandbox:
                  summary: Sandbox
                  value:
                    success: true
                    data:
                      telegramIds:
                        - sandbox_tg_1
                      status: QUEUED
                      count: 1
                      sandbox: true
        '400':
          description: Validacao
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                message: Missing template variables
                missingVariables:
                  - codigo
                code: BAD_REQUEST
        '403':
          description: Escopo ou creditos
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Forbidden
                message: 'Missing scope: voice:call'
                code: FORBIDDEN
        '404':
          description: Nao encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TemplateSendRequest:
      type: object
      required:
        - to
        - template
        - channels
      properties:
        to:
          type: array
          items:
            type: string
          minItems: 1
          example:
            - '5511999999999'
            - cliente@email.com
            - '@usuario_telegram'
            - cldevice123
        template:
          type: string
          description: ID ou nome do template
          example: alerta_pedido
        variables:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
          example:
            codigo: '12345'
            name: Maria
        channels:
          type: array
          items:
            type: string
            enum:
              - whatsapp
              - sms
              - email
              - telegram
              - rcs
              - push
              - voice
          minItems: 1
          example:
            - whatsapp
            - sms
            - email
            - telegram
            - rcs
            - push
            - voice
        instanceId:
          type: string
          example: cuid_instancia_whatsapp
        sendingPoolId:
          type: string
        schedule:
          type: object
          properties:
            sendAt:
              type: string
              format: date-time
              example: '2026-07-10T15:00:00.000Z'
        options:
          type: object
          properties:
            priority:
              type: string
              enum:
                - high
                - normal
                - low
              example: normal
            webhook:
              type: object
              properties:
                url:
                  type: string
                  example: https://example.com/hooks
                secret:
                  type: string
                  example: whsec_xxx
        push:
          type: object
          required:
            - pushAppId
          properties:
            pushAppId:
              type: string
              example: clapp123
            schedule:
              type: object
              properties:
                sendAt:
                  type: string
                  format: date-time
            options:
              type: object
              additionalProperties: true
            pushTargetLocale:
              type: string
            localization:
              type: object
              properties:
                mode:
                  type: string
                sourceLocale:
                  type: string
            i18n:
              type: object
              additionalProperties: true
        voice:
          type: object
          required:
            - from
          properties:
            from:
              type: string
              description: ID do numero do workspace ou E.164
              example: '+5511400000000'
            machineDetection:
              type: string
              example: detect
            gather:
              type: object
              properties:
                prompt:
                  type: string
                maxDigits:
                  type: integer
                timeoutSecs:
                  type: integer
                voice:
                  type: string
        telegram:
          type: object
          properties:
            instanceId:
              type: string
              example: cuid_instancia_telegram
        from:
          type: string
          description: Remetente email
          example: ola@meudominio.com.br
        fromName:
          type: string
          example: Equipe Notifique
        localization:
          type: object
          properties:
            mode:
              type: string
            sourceLocale:
              type: string
        i18n:
          type: object
          additionalProperties: true
    TemplateSendResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          required:
            - status
            - count
          description: >-
            Arrays de IDs so aparecem se o canal gerou envio. Campos ausentes
            nao sao arrays vazios.
          properties:
            messageIds:
              type: array
              items:
                type: string
              description: IDs internos WhatsApp
              example:
                - clmsg_wa1
            smsIds:
              type: array
              items:
                type: string
              description: IDs internos SMS
              example:
                - clsms1
            emailIds:
              type: array
              items:
                type: string
              description: IDs internos Email
              example:
                - clemail1
            telegramIds:
              type: array
              items:
                type: string
              description: IDs internos Telegram
              example:
                - cltg1
            rcsIds:
              type: array
              items:
                type: string
              description: IDs internos RCS
              example:
                - clrcs1
            pushIds:
              type: array
              items:
                type: string
              description: IDs internos Push
              example:
                - clpush1
            voiceCallIds:
              type: array
              items:
                type: string
              description: IDs internos Voice
              example:
                - clvoice1
            status:
              type: string
              enum:
                - QUEUED
              example: QUEUED
            count:
              type: integer
              example: 7
            sandbox:
              type: boolean
              example: true
            smsSkippedRecipients:
              type: array
              items:
                type: string
              example:
                - '5511888777666'
            localization:
              type: object
              properties:
                appliedAiLocales:
                  type: array
                  items:
                    type: string
                  example:
                    - en
                    - es
                fallbackLocales:
                  type: array
                  items:
                    type: string
                  example:
                    - pt
                aiTranslationLocaleCount:
                  type: integer
                  example: 2
      example:
        success: true
        data:
          messageIds:
            - clmsg_wa1
          smsIds:
            - clsms1
          emailIds:
            - clemail1
          telegramIds:
            - cltg1
          rcsIds:
            - clrcs1
          pushIds:
            - clpush1
          voiceCallIds:
            - clvoice1
          status: QUEUED
          count: 7
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Bad Request
          description: 'Rótulo HTTP do erro (ex.: Unauthorized, Bad Request, Not Found).'
        message:
          type: string
          example: Template not found
          description: >-
            Mensaje legível para exibir ao usuário (localizada via
            Accept-Language / x-locale quando aplicável).
        code:
          type: string
          example: INSUFFICIENT_CREDITS
          description: >-
            Código estável da API v1 (enum). Sempre presente em erros. Use com o
            status HTTP para decidir retry ou correção. Ver [Respuestas de
            erro](/guides/conceitos/resposta-de-erros).
        missingVariables:
          type: array
          items:
            type: string
          example:
            - codigo
            - name
      required:
        - success
        - error
        - message
        - code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````