{
"data": {
"success": true
}
}{
"error": "Missing recipient phone number"
}{
"error": "Failed to send the message"
}Send WhatsApp Template
Send WhatsApp messages using Meta-approved templates
{
"data": {
"success": true
}
}{
"error": "Missing recipient phone number"
}{
"error": "Failed to send the message"
}Overview
Send WhatsApp messages to your contacts using pre-approved templates. Perfect for:- Transactional notifications: Order updates, booking confirmations
- Customer support: Appointment reminders, service updates
- Marketing messages: Product launches, promotional offers (with opt-in)
- Authentication: OTP codes, verification messages
WhatsApp Template Requirements
Unlike emails, WhatsApp messages must use templates approved by Meta (Facebook). This ensures:- User privacy and experience
- Compliance with WhatsApp Business Policy
- Reduced spam and unwanted messages
Template Approval Process
- Create template in Minimo dashboard
- Submit for approval to Meta
- Wait 24-48 hours for review
- Use approved template via API
status: "APPROVED" can be used. Attempting to send with pending or rejected templates will fail.Template Categories
WhatsApp templates must be categorized:| Category | Description | Use Cases | 24h Window |
|---|---|---|---|
UTILITY | Account updates, transactions | Order status, booking confirmation | No |
AUTHENTICATION | OTP codes, verification | 2FA codes, login verification | No |
MARKETING | Promotional content | Product launch, special offers | Yes* |
Phone Number Format
WhatsApp requires phone numbers in E.164 format:+[country code][subscriber number]
- ✅
+393391234567(Italy) - ✅
+12025551234(US) - ✅
+447700900123(UK) - ❌
3391234567(missing country code) - ❌
+39 339 123 4567(contains spaces) - ❌
+39-339-123-4567(contains dashes)
Choosing the Sender (Multi-Number)
A company can connect more than one WhatsApp number (multi-sender / multi-WABA) — e.g. a support line and a marketing line. Control which number a message is sent from with the optionalsender field:
- Omit
sender→ the message is sent from the company preferred number. - Set
sender→ the message is sent from that number. Pass either the phone number (any formatting, e.g.+39 351 1234567) or the Metaphone_number_id.
{
"recipient": "393391234567",
"type": "template",
"sender": "+393517654321",
"template": {
"name": "product_launch",
"components": [
{ "type": "BODY", "parameters": [ { "type": "text", "text": "Jane" } ] }
]
}
}
sender returns WHATSAPP_SENDER_NOT_FOUND. Always source valid
values from
List WhatsApp Senders.recipient isn’t a contact yet, this send creates one (marked “created via
API”). Use the optional contactSource field to label where it came from (defaults to
WhatsApp); existing contacts are never modified.Template Variables
Templates support dynamic content through placeholders. Meta allows two placeholder styles, and the style is fixed when the template is created:- Positional: numbered placeholders like
{{1}},{{2}} - Named: descriptive placeholders like
{{customer_name}},{{order_id}}
Positional Variables
Template Example (created in dashboard):Hello {{1}}, your order {{2}} has been confirmed!
Total: {{3}}
Estimated delivery: {{4}}
Track your order: {{5}}
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "order_confirmation",
"components": [
{
"type": "BODY",
"parameters": [
{ "type": "text", "text": "Jane Doe" },
{ "type": "text", "text": "ORD-12345" },
{ "type": "text", "text": "$99.99" },
{ "type": "text", "text": "November 20, 2025" },
{ "type": "text", "text": "https://track.example.com/12345" }
]
}
]
}
}
{{1}}, not {{0}}. Order matters - map parameters in the exact sequence defined in your template.type to "template" to send an approved template, or "text" (with a top-level
text field) for a free-form session message. Component type values are uppercase:
HEADER, BODY, FOOTER, BUTTONS. companyId is resolved from your API key — never
send it in the body.Named Variables
For templates with named placeholders, addparameter_name to each body parameter to state which placeholder the value fills:
Template Example (created in dashboard):
Hello {{customer_name}}, your order {{order_id}} has been confirmed!
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "order_confirmation_named",
"components": [
{
"type": "BODY",
"parameters": [
{ "type": "text", "text": "Jane Doe", "parameter_name": "customer_name" },
{ "type": "text", "text": "ORD-12345", "parameter_name": "order_id" }
]
}
]
}
}
parameter_name is recommended but optional. If you omit it, Minimo resolves the names automatically from the approved template definition, matching your parameters by position: the first parameter fills the first placeholder appearing in the template body, and so on. When relying on this fallback, the order of your parameters must follow the order in which the placeholders appear in the template.parameter_name values, every name must match a placeholder defined in the template — a wrong or missing name is rejected by Meta with (#100) Invalid parameter.WhatsApp Message Components
Templates can have multiple components:Header (Optional)
- Text, image, document, or video
- Single dynamic variable supported
Body (Required)
- Main message content
- Supports multiple variables
- Maximum 1024 characters
Footer (Optional)
- Additional info (e.g., “Reply STOP to opt-out”)
- No variables allowed
Buttons (Optional)
- Call-to-action buttons
- Quick reply buttons
- URL buttons with dynamic parameters
Use Cases
Order Confirmation
Order Confirmation
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "order_confirmation",
"components": [
{
"type": "BODY",
"parameters": [
{"type": "text", "text": "Mario Rossi"},
{"type": "text", "text": "ORD-789"},
{"type": "text", "text": "€149.99"}
]
}
]
}
}
Appointment Reminder
Appointment Reminder
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "appointment_reminder",
"components": [
{
"type": "BODY",
"parameters": [
{"type": "text", "text": "Dr. Smith"},
{"type": "text", "text": "November 15, 2025"},
{"type": "text", "text": "10:30 AM"},
{"type": "text", "text": "Via Roma 123, Milano"}
]
}
]
}
}
OTP Verification
OTP Verification
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "otp_code",
"components": [
{
"type": "BODY",
"parameters": [
{"type": "text", "text": "847592"},
{"type": "text", "text": "5 minutes"}
]
}
]
}
}
Shipping Update
Shipping Update
{
"recipient": "393391234567",
"type": "template",
"template": {
"name": "shipping_update",
"components": [
{
"type": "BODY",
"parameters": [
{"type": "text", "text": "ORD-12345"},
{"type": "text", "text": "Out for delivery"},
{"type": "text", "text": "https://track.example.com/12345"}
]
}
]
}
}
Best Practices
Message Quality Score
WhatsApp monitors your message quality. Maintain a high quality score by:- ✅ Only sending to users who opted in
- ✅ Sending relevant, timely messages
- ✅ Using clear, professional language
- ✅ Respecting the 24-hour window for marketing
- ❌ Avoid spam-like behavior
- ❌ Don’t send unsolicited messages
- ❌ Don’t exceed rate limits
Phone Number Validation
Always validate before sending:function isValidE164(phone) {
// Basic E.164 validation
return /^\+[1-9]\d{1,14}$/.test(phone);
}
if (!isValidE164(phone)) {
console.error('Invalid phone number format');
return;
}
Template Design Guidelines
- Be concise: Keep messages short and clear
- Add context: Include order numbers, dates, etc.
- Include branding: Mention your company name
- Provide value: Every message should be useful
- Call-to-action: Make next steps obvious
Rate Limits & Messaging Tiers
WhatsApp enforces tiered messaging limits:| Tier | Daily Limit | How to Advance |
|---|---|---|
| Tier 1 | 1,000 | Maintain quality score |
| Tier 2 | 10,000 | Consistent quality + volume |
| Tier 3 | 100,000 | High quality + high volume |
| Tier 4 | Unlimited | Enterprise approval |
Common Errors
| Error | Cause | Solution |
|---|---|---|
template_not_approved | Template pending/rejected | Check status in dashboard, resubmit if needed |
invalid_phone_number | Phone not in E.164 format | Add country code, remove spaces/dashes |
template_not_found | Wrong template name | Verify template name in dashboard |
parameter_mismatch | Wrong number of variables | Match template variable count exactly |
(#100) Invalid parameter | Wrong parameter_name on a named template | Use the exact placeholder names defined in the template, or omit parameter_name and send parameters in template order |
rate_limit_exceeded | Messaging tier limit reached | Wait for reset or request tier upgrade |
recipient_not_on_whatsapp | Phone number not on WhatsApp | Verify number is active on WhatsApp |
Tracking & Analytics
Monitor message delivery and engagement:- Delivery status: Sent, delivered, read
- Failure reasons: Why messages didn’t deliver
- Response rate: How many users reply
24-Hour Messaging Window
For Marketing Templates
After a user-initiated conversation, you have a 24-hour window to send marketing messages without requiring a new opt-in. User-initiated means:- User sends a message to your WhatsApp number
- User clicks a WhatsApp link
- User interacts with your WhatsApp ad
Compliance & Opt-In
User Consent Required
- Get explicit opt-in before sending WhatsApp messages
- Keep records of consent
- Honor opt-out requests immediately
- Follow GDPR and local privacy regulations
Opt-Out Handling
Include opt-out instructions in templates:Don't want to receive these messages? Reply STOP to opt out.
Related Endpoints
- List WhatsApp Senders - Connected numbers you can send
senderfrom - List WhatsApp Templates - View all available templates
- Inbound & Webhooks - How replies and template-status updates arrive
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Phone number of the recipient including country code
"393471234567"
Type of message to send
text, template "template"
Plain text message (used only if type is 'text')
"Hello, this is a plain text message."
Show child attributes
Show child attributes
Multi-sender: the connected WhatsApp number to send from, when the company has more than one. Accepts the phone number (E.164 or any formatting, e.g. +39 351 1234567) or the Meta phone_number_id. Omit to use the company preferred number. An unknown/foreign number returns WHATSAPP_SENDER_NOT_FOUND. List valid values via GET /public/v1/templates/whatsapp/senders.
"+393511234567"
Contact source recorded when the recipient does not exist yet and is created as a Minimo contact by this send (defaults to WhatsApp). Does not modify existing contacts. The contact source type is always system-defined and cannot be set by the caller.
64"WhatsApp"
Response
Message sent successfully
Show child attributes
Show child attributes