Mailrelay API Reference

Bulk update subscribers

PATCH /subscribers/bulk_update

This method allows bulk updating subscribers. It should be used when you expect to update a large number of subscribers.

Asynchronous method

Important! This method is asynchronous, meaning that your request will be processed in a background task. You can specify a callback URL to receive a POST request after the update was processed.

Depending on the number of subscribers that will be updated, it can take several minutes.

Supported actions

At this moment, the only supported action is removefromgroup, which removes the subscribers from a group.

You can use the subscriberids parameter to specify which subscribers will be updated. Or you can set allsubscribers params to true, which results in all subscribers being updated.

If both options are specified, an error will be returned.

Parameters

NameTypeDescription
bulk_action string Action that will be performed.
group_id integer Required when bulk action is remove_from_group.
all_subscribers boolean Set to true if you would like to update all subscribers instead of specific ones.
subscriber_ids array IDs of the subscribers that will be updated. Required unless you set all_subscribers param to true.
callback_url string A URL that will be called when the bulk update has finished. A POST request will be sent to this URL with a JSON payload containing the ID of the bulk update task.

Responses

StatusDescription
202 Request is correct. It will be processed later.
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.