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 Late 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.
Name 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
curl -X POST "https://getlate.dev/api/v1/whatsapp/templates" \ -H "Content-Type: application/json" \ -d '{ "accountId": "507f1f77bcf86cd799439011", "name": "order_confirmation", "category": "UTILITY", "language": "en_US", "components": [ { "type": "body", "text": "Your order {{1}} has been confirmed. Expected delivery: {{2}}" } ] }'{
"success": true,
"template": {
"id": "string",
"name": "string",
"status": "string",
"category": "string",
"language": "string"
}
}{
"error": "Unauthorized"
}