Create Message Template
Create a new WhatsApp message template. Templates can be categorized as UTILITY/MARKETING or AUTHENTICATION.
POST /whatsapp/templates/
Headers
| Name | Value |
|---|---|
| Authorization | Bearer Access Token |
| Content-Type | application/json |
Payload
namerequiredTemplate name
languagerequiredTemplate language code (e.g., 'en', 'en_US')
categoryrequiredTemplate category
MARKETING- MARKETINGUTILITY- UTILITY
componentsrequiredarray of objectTemplate components array. Currently only BODY component is supported
componentsrequiredTemplate components array. Currently only BODY component is supported
typerequiredComponent type (currently only 'BODY' is supported)
textrequiredText content of the template. Use {{1}}, {{2}}, etc. for variables that will be replaced with actual values when sending
exampleobjectExample values for template variables (required if template has variables like {{1}}, {{2}})
exampleExample values for template variables (required if template has variables like {{1}}, {{2}})
body_textrequiredExample values for template variables. Provide as 2D array: [["example1", "example2"]] where each inner array represents example values for {{1}}, {{2}}, etc.
Response
{ "success": true, "name": "welcome_message", "template_id": "<WhatsApp Template ID>", "status": "<PENDING/APPROVED/REJECTED>", "language": "<language code (e.g., en_US)>", "business_account": "<Business Account ID in FreJun>", "category": "<template category (MARKETING/UTILITY/AUTHENTICATION)>", "components": "<template components array>"}Authentication templates are specifically designed for sending one-time passwords (OTPs) and verification codes. These templates provide a streamlined user experience with features like copy-to-clipboard buttons.
POST /whatsapp/templates/
Headers
| Name | Value |
|---|---|
| Authorization | Bearer Access Token |
| Content-Type | application/json |
Payload
namerequiredAuthentication template name (lowercase, use underscores)
languagerequiredTemplate language code (e.g., 'en_US')
categoryrequiredMust be 'AUTHENTICATION' for OTP/verification templates
AUTHENTICATION- AUTHENTICATION
componentsrequiredarray of objectComponents for authentication template: BODY (with security), FOOTER (expiration), BUTTONS (copy code)
componentsrequiredComponents for authentication template: BODY (with security), FOOTER (expiration), BUTTONS (copy code)
typerequiredComponent type for authentication templates
BODY- BODYFOOTER- FOOTERBUTTONS- BUTTONS
add_security_recommendationFor BODY: Add security disclaimer (WhatsApp auto-generates)
code_expiration_minutesFor FOOTER: OTP expiration time in minutes (e.g., 10)
buttonsarray of objectFor BUTTONS: Array of button configurations
buttonsFor BUTTONS: Array of button configurations
typerequiredButton type (must be 'OTP' for auth templates)
OTP- OTP
otp_typerequiredOTP button type (use 'COPY_CODE' for copy-to-clipboard)
COPY_CODE- COPY_CODE
textrequiredButton text. Always use 'Copy Code' as the value.
Response
{ "name": "<template name>", "language": "en_US", "template_id": "<WhatsApp Template ID>", "status": "<APPROVED/PENDING/REJECTED>", "business_account": "<Business Account ID in FreJun>", "category": "AUTHENTICATION", "components": [ { "type": "BODY", "add_security_recommendation": true }, { "type": "FOOTER", "code_expiration_minutes": 10 }, { "type": "BUTTONS", "buttons": [ { "type": "OTP", "otp_type": "COPY_CODE", "text": "Copy Code" } ] } ], "success": true}