API Reference
Messages

Send a message

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

Sends a message to a WhatsApp user: text, template, media, interactive, location, contacts or reaction. The response only means the message was accepted; delivery is reported asynchronously by the messages webhook with statuses (sent, delivered, read or failed with an error).

Free-form messages (anything but templates) need an open customer service window: the user must have messaged you in the last 24 hours. Outside it, the request is accepted and the status webhook reports failed with 131047.

In Mimicr, what happens after acceptance depends on the recipient: test numbers follow their persona and the sandbox mode, other numbers follow the audience rules. See the sandbox testing guide.

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
text
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).

typestring

Message type.

text
textobjectrequired
Show child attributes
bodystringrequired

Message text, up to 4096 characters. URLs are allowed.

preview_urlboolean

Renders a link preview for the first URL in body.

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

image | audio | video | document | sticker
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.

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

audioobject

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.

stickerobject

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.

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

interactive
interactiveobjectrequired
Show child attributes
typestringrequired

Interactive message type.

buttonlistcta_urlflowlocation_request_messageproductproduct_listcatalog_message
headerobject
Show child attributes
typestring

Header type.

textimagevideodocument
textstring

Header text, up to 60 characters.

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.

bodyobject
Show child attributes
textstring

Body text: up to 1024 characters for button, 4096 for the others. Required except for product.

footerobject
Show child attributes
textstring

Footer text, up to 60 characters.

actionobjectrequired
Show child attributes
buttonsobject[]

button: 1 to 3 reply buttons.

Show child attributes
typestring

Always reply.

reply
replyobject
Show child attributes
idstringrequired

Unique button ID, up to 256 characters. Returned in the button_reply webhook.

titlestringrequired

Button label, up to 20 characters.

buttonstring

list: label of the button that opens the list, up to 20 characters.

sectionsobject[]

list: 1 to 10 sections with at most 10 rows in total.

Show child attributes
titlestring

Section title, up to 24 characters. Required with more than one section.

rowsobject[]
Show child attributes
idstringrequired

Unique row ID, up to 200 characters.

titlestringrequired

Row title, up to 24 characters.

descriptionstring

Row description, up to 72 characters.

namestring

cta_url, flow or send_location, matching the interactive type.

parametersobject
Show child attributes
display_textstring

cta_url: button label, up to 20 characters.

urlstring

cta_url: URL opened by the button.

flow_idstring

flow: Flow ID (or flow_name).

flow_ctastring

flow: button label, up to 20 characters.

flow_tokenstring

flow: token returned in the nfm_reply webhook.

flow_actionstring

flow: navigate or data_exchange.

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

location
locationobjectrequired
Show child attributes
latitudenumberrequired

Latitude.

longitudenumberrequired

Longitude.

namestring

Location name.

addressstring

Address.

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

contacts
contactsobject[]required

Contact cards.

Show child attributes
nameobjectrequired
Show child attributes
formatted_namestringrequired

Full name, required.

first_namestring

First name.

phonesobject[]
Show child attributes
phonestring

Phone number.

typestring

CELL, HOME, WORK…

wa_idstring

WhatsApp ID.

emailsobject[]
Show child attributes
emailstring

E-mail.

typestring

HOME or WORK.

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

reaction
reactionobjectrequired
Show child attributes
message_idstringrequired

wamid of the message to react to.

emojistringrequired

Emoji. An empty string removes the reaction.

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 message. Common codes: 100 (missing or invalid parameter), 131009 (parameter value not valid), 131051 (unsupported type), 132000 (template parameter count mismatch), 132001 (template does not exist or is not approved), 132015/132016 (template paused/disabled), 133010 (number not registered), 131056 (pair rate limit), 130429 (throughput reached).
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.