Skip to Content
Send WhatsApp MessageTemplate Variables

Template Variables

Fetch the template first, then read expected_variables to know what to pass in variables. Use each param_name as the key.

POST /v1/whatsapp/send

See Templates for how to read expected_variables, and Send a Message for the full request body.


Named variables

Placeholders use string names like {{customer_name}}. The param_name is a string — use it as the key.

// expected_variables.body: // [ { "param_name": "customer_name", "example": "John Doe" }, // { "param_name": "order_id", "example": "ORD-12345" } ]
curl -X POST https://api.bahasha.app/v1/whatsapp/send \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": "+254700000000", "phone_number_id": "123456789", "template_name": "order_confirmation", "language_code": "en_US", "variables": { "body": { "customer_name": "Jane Smith", "order_id": "ORD-78901" } } }'

Positional variables

Placeholders use numbers like {{1}}, {{2}}. The param_name is a number — use the number as a string key.

// expected_variables: // header: [ { "param_name": 1, "example": "Acme Corp" } ] // body: [ { "param_name": 1, "example": "John" }, // { "param_name": 2, "example": "2026-03-01" } ]
curl -X POST https://api.bahasha.app/v1/whatsapp/send \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "to": "+254700000000", "phone_number_id": "123456789", "template_name": "appointment_reminder", "language_code": "en_US", "variables": { "header": { "1": "Acme Corp" }, "body": { "1": "John", "2": "2026-03-01" } } }'

A template is either named or positional throughout — you cannot mix the two styles in one template. Carousel card bodies are the one exception: their placeholders are always numbered even on a named template. See Carousels.