Mailrelay API Reference

Send WhatsApp campaign

POST /whatsapp/campaigns/{id}/send_all

This method is used to send a WhatsApp campaign to groups or a specific segment. It will return some attributes, including the ID of the WhatsApp sent campaign which can be used to check the progress and results of the WhatsApp campaign.

If you specify a callback URL, we will send a POST request right after the WhatsApp sent campaign is processed. It will contain a JSON with the type of the callback and the ID of the WhatsApp sent campaign.

You can use the following command to simulate a callback request:

curl --request POST \
  --url https://your-callback-domain.com/callback-url \
  --header 'content-type: application/json' \
  --data '{"type":"whatsapp_sent_campaign_finished","id":1}'

Parameters

NameTypeDescription
id integer ID of the record
target string Translation missing: en.api_docs.whatsapp/campaign.target
group_ids array Translation missing: en.api_docs.whatsapp/campaign.group_ids
segment_id integer Translation missing: en.api_docs.whatsapp/campaign.segment_id
scheduled_at string Translation missing: en.api_docs.whatsapp/campaign.scheduled_at
callback_url string A URL that will be called after the campaign is sent. A POST request will be sent to this URL with a JSON payload containing the ID of the sent campaign.

Responses

StatusDescription
200 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.