Mailrelay API Reference

Get subscribers

GET /subscribers

Lists all subscribers.

Pagination

This is a paginated resource. You can optionally send two query parameters:

Parameter Description
page The page that you want to retrieve. It starts with 1.
per_page The number of records returned per page. The max allowed value for this resource is 10000.

The response will include two HTTP headers:

Header Description
Total The total number of pages based on your parameters. You can use this option to know when you've reached the end of the pagination.
Per-Page The number of records returned per page.

Parameters

NameTypeDescription
page integer Page number
per_page integer Number of records per page
include_groups boolean Include subscriber's groups in the response.
include_tags boolean Include subscriber's tags in the response.
q[by_status] string Search by status. Values can be: - <strong>active</strong>: Active subscribers - <strong>inactive</strong>: Inactive subscribers - <strong>disabled</strong>: Disabled subscribers include those that bounced, reported spam, unsubscribed or are banned.
q[banned] boolean Search subscribers that are banned.
q[bounced] boolean Search subscribers that bounced.
q[reported_spam] boolean Search subscribers that reported spam.
q[unsubscribed] boolean Search subscribers that unsubscribed.
q[groups_id_eq_any][] array Search subscribers that belongs to any of the selected groups
q[tags_name_eq_any][] array Search subscribers that have any of the selected tag names
q[id_eq] integer Search: ID equals
q[id_gteq] integer Search: ID greater than or equal to
q[id_lteq] integer Search: ID less than or equal to
q[email_eq] string Search: Email equals
q[email_cont] string Search: Email contains
q[sms_phone_eq] string Search: SMS phone equals
q[sms_phone_cont] string Search: SMS phone contains
q[whatsapp_phone_eq] string Search: WhatsApp phone equals
q[whatsapp_phone_cont] string Search: WhatsApp phone contains
q[name_eq] string Search: Name equals
q[name_cont] string Search: Name contains
q[score_eq] integer Search: Score equals
q[score_gteq] integer Search: Score greater than or equal to
q[score_lteq] integer Search: Score less than or equal to
q[created_at_eq] string Search: Created at equals
q[created_at_gteq] string Search: Created at greater than or equal to
q[created_at_lteq] string Search: Created at less than or equal to
q[updated_at_eq] string Search: Updated at equals
q[updated_at_gteq] string Search: Updated at greater than or equal to
q[updated_at_lteq] string Search: Updated at less than or equal to
q[s] string Allows ordering the records based on a specific field. You may optionally append "asc" or "desc" to define the direction. Example: "id desc"

Responses

StatusDescription
200 Success
401 The API key wasn't sent or is invalid
500 An internal error happened. Try again later.