---
title: "Send a whatsapp template message"
url: https://docs.gleap.ai/en/reference/rest-api/send-whatsapp-template-message
method: POST
path: "/engagement/whatsapp-messages/send-template"
api: "API Reference"
tag: "Engagement Whatsapp Messages"
operationId: "SendWhatsappTemplateMessage"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Send a whatsapp template message

`POST https://api.gleap.io/v3/engagement/whatsapp-messages/send-template`

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 }`.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `customValues` (any): 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` (string): 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` (string, required): Name of the WhatsApp template registered with Meta
- `channelId` (string, required): The WhatsApp channel ID from your project
- `to` (string, required): Recipient phone number (E.164 format, e.g. "+14155552671")

## Example request

```bash
curl --request POST \
  --url https://api.gleap.io/v3/engagement/whatsapp-messages/send-template \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "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 (`application/json`)

Ok
