Mailrelay API Reference

Send WhatsApp messages to one or more recipients

POST /whatsapp/send

Send template-based WhatsApp messages to one or more recipients using approved templates.

Template variables must follow these naming conventions: - subscriber* : Built-in subscriber fields (e.g., subscribername, subscriberemail) - custom* : Arbitrary custom values (e.g., customorderid, customdeliverydate)

The response will return an array with the details of each message including the ID, which can be used to verify the status later.

Parameters

NameTypeDescription
to array Array of phone numbers in E.164 format (e.g., +1234567890)
whatsapp_template_id integer ID of the approved WhatsApp template to use
whatsapp_phone_number_id integer ID of the WhatsApp phone number to send from
template_parameters object Template variable values.

Responses

StatusDescription
201 Success
400 The request is invalid. Check if the field names in the request and the request data is valid.
422 A validation error occurred. Check the response body for more information.
401 The API key wasn't sent or is invalid
500 An internal error happened. Try again later.