Create template
Create a new message template. Supports two modes: Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h). Library template: Provide library_template_name instead of components to use a pre-built template from Meta's template library. Library templates are pre-approved (no review wait). You can optionally customize parameters and buttons via library_template_body_inputs and library_template_button_inputs. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
API key authentication - use your Zernio API key as a Bearer token
In: header
WhatsApp social account ID
Template name (lowercase, letters/numbers/underscores, must start with a letter)
^[a-z][a-z0-9_]*$Template category
"AUTHENTICATION" | "MARKETING" | "UTILITY"Template language code (e.g., en_US)
Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name.
1 <= itemsName of a pre-built template from Meta's template library (e.g., "appointment_reminder", "auto_pay_reminder_1", "address_update"). When provided, the template is pre-approved by Meta with no review wait. Omit components when using this field.
Optional body customizations for library templates. Available options depend on the template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation, add_track_package_link, code_expiration_minutes).
Optional button customizations for library templates. Each item specifies button type and configuration (e.g., URL, phone number, quick reply).
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.whatsapp.createWhatsAppTemplate({ body: { accountId: 'account_abc123', name: 'Example', category: 'AUTHENTICATION', language: 'string', },});console.log(data);{
"success": true,
"template": {
"id": "string",
"name": "string",
"status": "string",
"category": "string",
"language": "string"
}
}{
"error": "Unauthorized"
}