Mailrelay API Reference

Bulk update subscribers

PATCH https://{account}/api/v1/subscribers/bulk_update

Authentication

Requires an API key sent in the X-AUTH-TOKEN header.

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

NameTypeRequiredDescription
bulk_action string Yes Action that will be performed.
group_id integer No Required when bulk action is remove_from_group.
all_subscribers boolean No Set to true if you would like to update all subscribers instead of specific ones.
subscriber_ids array No IDs of the subscribers that will be updated. Required unless you set all_subscribers param to true.
callback_url string No 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, is invalid or has expired
403 The API key or its user doesn't have permission to use this endpoint, or the request comes from an IP address the key doesn't allow.
429 Too many requests. You have exceeded the rate limit, wait and try again later.
500 An internal error happened. Try again later.

Response fields

NameTypeDescription
id integer Id