API Reference
Templates

Create a template

POST/{waba-id}/message_templates
Base URL: https://whatsapp.mimicr.dev/v24.0 · provider: https://graph.facebook.com/v24.0

Creates a message template. It starts as PENDING while Meta reviews it; the outcome arrives in the message_template_status_update webhook (APPROVED or REJECTED with a reason). The same name in the same language returns subcode 2388024; an invalid name returns 2388042.

In Mimicr, nobody reviews automatically: approve, reject, pause or disable the template from the console or the control API (POST /v1/whatsapp/{slug}/templates/{id}/review), and the webhook goes out at once.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

waba-idstringrequired

WhatsApp Business Account (WABA) ID.

Example: "313255174969123"

Body

application/json
namestringrequired

Template name: lowercase letters, numbers and underscores, up to 512 characters.

languagestringrequired

Language and locale code.

Example: "pt_BR"
categorystringrequired

Category.

MARKETINGUTILITYAUTHENTICATION
parameter_formatstring

Variable format.

POSITIONALNAMED
message_send_ttl_secondsinteger

Time-to-live of messages: -1 or 30 to 2592000 seconds.

componentsobject[]

Components. A BODY is required except for AUTHENTICATION (which gets a default body). A JSON-encoded string of the array is accepted too.

Show child attributes
typestringrequired

Component type.

HEADERBODYFOOTERBUTTONS
formatstring

HEADER format.

TEXTIMAGEVIDEODOCUMENTLOCATION
textstring

Text with variables {{1}}, {{2}}… (or {{name}} with parameter_format: NAMED).

exampleobject

Sample values, required when the component has variables.

Show child attributes
body_textstring[][]

Sample values of the body variables.

header_textstring[]

Sample values of the header variables.

header_handlestring[]

Handle of a sample header media, from the Resumable Upload API.

add_security_recommendationboolean

Authentication BODY: appends the security disclaimer.

code_expiration_minutesinteger

Authentication FOOTER: code expiry in minutes (1 to 90).

buttonsobject[]

BUTTONS: 1 to 10 buttons.

Show child attributes
typestringrequired

Button type.

QUICK_REPLYURLPHONE_NUMBERCOPY_CODEOTPFLOWCATALOGMPMVOICE_CALL
textstring

Button label.

urlstring

URL button target, may end with a {{1}} variable.

phone_numberstring

PHONE_NUMBER button.

otp_typestring

OTP button: COPY_CODE, ONE_TAP or ZERO_TAP.

exampleany

Sample value.

Responses

200Template created.
idstring

Template ID.

statusstring

PENDING.

categorystring

Category.

400Invalid request. The body follows the Graph API error envelope; code identifies the error (for example 100 invalid parameter, 131009 parameter value not valid).
errorobjectrequired
Show child attributes
messagestringrequired

Human-readable error message, for WhatsApp errors prefixed with (#code).

typestringrequired

Exception type.

Example: "OAuthException"
codeintegerrequired

Error code. See the error codes reference.

error_subcodeinteger

More specific code, when there is one (for example 33 for objects that do not exist or are not visible to the token, 460 for revoked tokens, 2388024 for duplicate templates).

error_user_titlestring

Title meant to be shown to the end user.

error_user_msgstring

Message meant to be shown to the end user.

error_dataobject
Show child attributes
messaging_productstring

Always whatsapp.

detailsstring

Details about the error.

fbtrace_idstringrequired

Trace ID. Include it when you contact support.

401Missing, invalid or revoked access token (190; a revoked token adds error_subcode: 460). A missing token answers 400 with code 104.
errorobjectrequired
Show child attributes
messagestringrequired

Human-readable error message, for WhatsApp errors prefixed with (#code).

typestringrequired

Exception type.

Example: "OAuthException"
codeintegerrequired

Error code. See the error codes reference.

error_subcodeinteger

More specific code, when there is one (for example 33 for objects that do not exist or are not visible to the token, 460 for revoked tokens, 2388024 for duplicate templates).

error_user_titlestring

Title meant to be shown to the end user.

error_user_msgstring

Message meant to be shown to the end user.

error_dataobject
Show child attributes
messaging_productstring

Always whatsapp.

detailsstring

Details about the error.

fbtrace_idstringrequired

Trace ID. Include it when you contact support.