API Reference
Messages

Send a marketing message

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

Marketing Messages API: sends a MARKETING template through the marketing messages pipeline. Only type: template is accepted (131009 otherwise). In Mimicr it uses the same delivery engine as /messages.

Authorization

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

Path parameters

phone-number-idstringrequired

WhatsApp Business phone number ID.

Example: "424361664134261"

Body

application/json
messaging_productstringrequired

Messaging service. Must be whatsapp.

whatsapp
recipient_typestring

Recipient type.

individualgroup
tostringrequired

WhatsApp ID or phone number of the recipient, with country code. In Mimicr, Brazilian numbers with or without the ninth digit resolve to the same wa_id.

Example: "5511987654321"
contextobject

Sends the message as a reply to a previous message.

Show child attributes
message_idstringrequired

wamid of the message you are replying to.

biz_opaque_callback_datastring

Arbitrary string returned in the status webhooks of this message (up to 512 characters).

typestringrequired

Message type.

template
templateobjectrequired
Show child attributes
namestringrequired

Template name.

languageobjectrequired
Show child attributes
codestringrequired

Language and locale code of an approved translation of the template.

Example: "pt_BR"
componentsobject[]

Variable values. The number of parameters must match the template (132000 otherwise). Authentication templates take the code as the single body parameter and again in the url button.

Show child attributes
typestringrequired

Component the parameters fill.

headerbodybutton
sub_typestring

Button type, for button components.

quick_replyurlcopy_codeflow
indexstring

Position of the button (0-based), for button components.

parametersobject[]

Values of the variables, in order (or by parameter_name).

Show child attributes
typestringrequired

Parameter type.

textcurrencydate_timeimagevideodocumentlocationpayloadcoupon_codeaction
parameter_namestring

Parameter name, for templates created with parameter_format: NAMED.

textstring

Text value.

payloadstring

Payload returned in the button webhook when a quick reply is tapped.

coupon_codestring

Coupon code of a copy_code button.

currencyobject
Show child attributes
fallback_valuestring

Default text.

codestring

ISO 4217 currency code.

amount_1000integer

Amount multiplied by 1000.

date_timeobject
Show child attributes
fallback_valuestring

Default text.

imageobject

Media to send. Use either id or link.

Show child attributes
idstring

Media ID from POST /{phone-number-id}/media. Required when link is not set.

linkstring

Public http(s) URL of the media. Required when id is not set.

captionstring

Caption. Not allowed for audio and sticker.

filenamestring

File name shown to the recipient. Documents only.

videoobject

Media to send. Use either id or link.

Show child attributes
idstring

Media ID from POST /{phone-number-id}/media. Required when link is not set.

linkstring

Public http(s) URL of the media. Required when id is not set.

captionstring

Caption. Not allowed for audio and sticker.

filenamestring

File name shown to the recipient. Documents only.

documentobject

Media to send. Use either id or link.

Show child attributes
idstring

Media ID from POST /{phone-number-id}/media. Required when link is not set.

linkstring

Public http(s) URL of the media. Required when id is not set.

captionstring

Caption. Not allowed for audio and sticker.

filenamestring

File name shown to the recipient. Documents only.

Responses

200Message accepted.
messaging_productstring

Always whatsapp.

contactsobject[]
Show child attributes
inputstring

The to you sent.

wa_idstring

WhatsApp ID of the recipient.

messagesobject[]
Show child attributes
idstring

Message ID (wamid). Status webhooks refer to it.

message_statusstring

Template messages only: accepted.

accepted
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.