Templates
Create a template
Stores a template with status DRAFT. It is not submitted to Meta for approval; create and approve templates in WhatsApp Manager, then sync them. Only owners and admins signed in to the app can call it.
- Console only: owner or admin
- Workspace:
X-Tenant-ID
Headers
CookiestringrequiredThe
whatsappx_sessioncookie the app sets when you sign in. Browsers send it automatically; API keys are not accepted on this endpoint.X-Tenant-IDuuidrequiredWorkspace id. Required for session requests. You can pass
?tenant=<id>instead.
Body
application/jsonnamestringrequiredTemplate name.
bodystringrequiredTemplate text.
categoryenumrequiredTemplate category.
languagestringrequiredWhatsApp language code.
Response
201 Createdapplication/json
iduuidTemplate id in whatsappx.si.
namestringTemplate name (lower case, digits and underscores).
bodystringTemplate body text.
categorystringMARKETING,UTILITYorAUTHENTICATIONfor templates created here; synced templates keep Meta’s category.languagestringLanguage code, for example
en_US.statusstringDRAFTfor templates created in whatsappx.si (they are not submitted to Meta). Synced templates carry the status Meta reports.created_atintegerCreation time in Unix seconds.
Status codes
- 201Created. The new draft.
- 400Bad request. A field is missing or invalid, for example
enter a template name,template name must start with a lowercase letter and use only lowercase letters, digits and underscores (for example order_confirmation),category must be UTILITY, MARKETING or AUTHENTICATION,language must be a WhatsApp language code such as en, en_US or pt_BR,enter the message bodyormessage body must be at most 1024 characters; a template with the same name and language exists (a template named order_ready in en_US already exists); or the body is not JSON (invalid body). - 401Unauthorized. No signed-in session (
unauthorized). - 403Forbidden. API keys can never call this endpoint (
API keys cannot administer workspaces). A signed-in user who is not an owner or admin getsadmin required; a user who is not a member of the workspace getsforbidden. - 500Server error. The template could not be saved.