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

# Send a whatsapp template message

> Send a WhatsApp template message to a phone number with optional custom variable values.
The customValues keys must match the templateVariable names from your variable mapping. In addition,
the reserved keys `header_image`, `header_video`, `header_document` and `header_media` override the
template's configured header media URL and do not need a variable-mapping entry.
When a custom value is provided for a variable, it takes priority over the mapped field resolution and fallback value.
Missing required fields or an unknown channel return 400; a send rejected by WhatsApp returns 409 with
`{ success: false, message }`.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json post /engagement/whatsapp-messages/send-template
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /engagement/whatsapp-messages/send-template:
    post:
      tags:
        - Engagement Whatsapp Messages
      summary: Send a whatsapp template message
      description: >-
        Send a WhatsApp template message to a phone number with optional custom
        variable values.

        The customValues keys must match the templateVariable names from your
        variable mapping. In addition,

        the reserved keys `header_image`, `header_video`, `header_document` and
        `header_media` override the

        template's configured header media URL and do not need a
        variable-mapping entry.

        When a custom value is provided for a variable, it takes priority over
        the mapped field resolution and fallback value.

        Missing required fields or an unknown channel return 400; a send
        rejected by WhatsApp returns 409 with

        `{ success: false, message }`.
      operationId: SendWhatsappTemplateMessage
      parameters:
        - in: header
          name: project
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                customValues:
                  description: >-
                    Key-value map of template variable overrides. Keys must
                    match the templateVariable names from your variable mapping
                    (e.g. { "order_number": "ORD-123", "customer_name": "John"
                    }). The reserved keys `header_image`, `header_video`,
                    `header_document` and `header_media` override the template's
                    header media URL.
                languageCode:
                  type: string
                  description: >-
                    Language code (e.g. "en_US"). Only used as a fallback: the
                    message is sent in the language Meta reports for the
                    template. If omitted, defaults to the contact's language,
                    then "en_US".
                templateName:
                  type: string
                  description: Name of the WhatsApp template registered with Meta
                channelId:
                  type: string
                  description: The WhatsApp channel ID from your project
                to:
                  type: string
                  description: Recipient phone number (E.164 format, e.g. "+14155552671")
              required:
                - templateName
                - channelId
                - to
              type: object
            example:
              to: '+14155552671'
              channelId: 6620f1a2b3c4d5e6f7890123
              templateName: order_confirmation
              languageCode: en_US
              customValues:
                order_number: ORD-2026-4821
                delivery_date: March 15, 2026
                customer_name: John Doe
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema: {}
      security:
        - jwt: []
components:
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````