Skip to content
View as Markdown
Enter your site to enable Send. Requests are sent from your browser, so the site must allow cross-origin calls (CORS).

POST Create WhatsApp Template​

POST
/whatsapp/templates

Create a template. For channel=whatsapp (default) the payload is validated against Meta's rules (see Validate), submitted to the configured provider for review, and stored locally with the status the provider returns (normally PENDING; Meta usually reviews within minutes). For channel=sms a local reusable text body is stored immediately as APPROVED; only name (max 192 chars) and body_text (max 1600 chars) are used and the name must be unique among non-DISABLED SMS templates.

WhatsApp specifics: name is passed through sanitize_key() (lowercased). category is upper-cased; the Meta driver silently falls back to MARKETING for anything other than MARKETING, UTILITY or AUTHENTICATION. Only the first 3 buttons are submitted. Header support is text only. Every {{n}} in the body needs a sample in variables or the request is refused with the validator's error list.

Failures are 422 with message and, for validation, an errors array: channel not enabled, validation errors, provider without template support, or the provider's own rejection message.

PRO (FluentCampaign Pro). The route exists only while the Messaging module (the messaging_module experimental setting) is switched on, and the policy answers 403 unless at least one channel (SMS or WhatsApp) is active.

Required capability: fcrm_manage_email_templates

Enforced by MessagePolicy::store().

Requires: FluentCampaign Pro with the Messaging module enabled. While no messaging channel (SMS or WhatsApp) is switched on the route is not registered at all and returns a 404.

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Request Body​

application/json
JSON
{
"channel": "whatsapp",
"name": "string",
"language": "en_US",
"category": "MARKETING",
"header_text": "string",
"body_text": "string",
"footer_text": "string",
"buttons": [
{
"type": "string",
"text": "string",
"url": "string",
"phone_number": "string"
}
],
"variables": {
"additionalProperties": "string"
}
}

Responses​

Template submitted (WhatsApp) or saved (SMS).

application/json
JSON
{
"message": "string",
"template": {
"id": 0,
"channel": "string",
"provider": "string",
"name": "string",
"language": "string",
"category": "string",
"status": "string",
"header_text": "string",
"body_text": "string",
"footer_text": "string",
"buttons": [
{
}
],
"variables": {
},
"provider_template_id": "string",
"rejection_reason": "string",
"last_synced_at": "string",
"created_by": 0,
"created_at": "string",
"updated_at": "string",
"provider_label": "string",
"current_provider": "string",
"current_provider_label": "string",
"is_current_provider": true,
"is_selectable": true,
"disabled_reason": "string"
},
"warnings": [
"string"
]
}

Playground​

Authorization
Body

Samples​

Powered by VitePress OpenAPI