Mailrelay API Reference

Get sent campaign's sent emails

GET /sent_campaigns/{id}/sent_emails

The default behavior is to only list sent emails without additional information like clicks, impressions or unsubscribe events.

You can optionally use parameters like includeclicks or includeimpressions to include them but note that it may slow down the response times, so only use them if you need it.

If you only need to obtain clicks, impressions or unsubscribe events, then you should use the methods that only return the data that you need.

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
id integer ID of the record
page integer Page number
per_page integer Number of records per page
include_impressions boolean Include impressions in the results
include_clicks boolean Include clicks in the results
include_unsubscribe_events boolean Include unsubscribe events in the results
q[email_eq] string Search: Email equals
q[email_cont] string Search: Email contains
q[status_eq] string Search: Status equals
q[status_cont] string Search: Status contains
q[processed_at_eq] string Search: Processed at equals
q[processed_at_gteq] string Search: Processed at greater than or equal to
q[processed_at_lteq] string Search: Processed at less than or equal to
q[delivered_at_eq] string Search: Delivered at equals
q[delivered_at_gteq] string Search: Delivered at greater than or equal to
q[delivered_at_lteq] string Search: Delivered at less than or equal to
q[bounced_at_eq] string Search: Bounced at equals
q[bounced_at_gteq] string Search: Bounced at greater than or equal to
q[bounced_at_lteq] string Search: Bounced at less than or equal to
q[bounce_category_eq] string Search: Bounce category equals
q[bounce_category_cont] string Search: Bounce category contains
q[soft_bounced_at_eq] string Search: Soft bounced at equals
q[soft_bounced_at_gteq] string Search: Soft bounced at greater than or equal to
q[soft_bounced_at_lteq] string Search: Soft bounced 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: "email desc"

Responses

StatusDescription
200 Success
401 The API key wasn't sent or is invalid
500 An internal error happened. Try again later.
404 Couldn't find record with provided ID.