REST API: WhatsApp Templates
Send WhatsApp template messages programmatically using the Bugalou REST API. Manage templates and variables.
Overview
The WhatsApp Templates API allows you to send approved WhatsApp template messages programmatically. This is useful for sending automated confirmations, reminders, and notifications from external systems. You need an API key to authenticate.
Authentication
Include your API key in every request:
X-API-Key: bg_live_your_key_hereAuthorization: Bearer bg_live_your_key_here
Send a Template Message
POST https://app.bugalou.com/api/templates/send
Authorization: Bearer bg_live_your_api_key_here
Content-Type: application/json
{
"template": "order_bevestiging",
"phone": "31612345678",
"variables": { "name": "Jan", "order": "12345" }
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
template | string | Yes | Template name (e.g. order_bevestiging) |
phone | string | Yes | Phone number with country code, no + (e.g. 31612345678) |
variables | object | No | Key-value pairs for template placeholders |
List Available Templates
GET https://app.bugalou.com/api/templates/send Authorization: Bearer bg_live_your_api_key_here
Returns an array of all approved templates with their names and expected variables.
Example Templates
verificatie_code— send a verification codeorder_bevestiging— order confirmation with order numberorder_verzonden— shipping notification with tracking infoafspraak_herinnering— appointment reminderfactuur_herinnering— invoice payment reminder
The number of API calls available depends on your plan.
Response Format
Success: {"success": true, "messageId": "..."}
Error: {"error": "Invalid or expired API key"} (401) or {"error": "Template not found"} (404)
Use Cases
- E-commerce: Send order confirmation and shipping updates from your webshop
- Service businesses: Send appointment reminders and invoice notifications
- Custom apps: Trigger WhatsApp messages from any system via HTTP