Mailrelay API Reference

Get sent campaign's sent emails

GET https://{account}/api/v1/sent_campaigns/{id}/sent_emails

Authentication

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

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.

Parameters

NameTypeRequiredDescription
id integer Yes ID of the record
page integer No Page number
per_page integer No Number of records per page
include_impressions boolean No Include impressions in the results
include_clicks boolean No Include clicks in the results
include_unsubscribe_events boolean No Include unsubscribe events in the results
q[email_eq] string No Search: Email equals
q[email_cont] string No Search: Email contains
q[status_eq] string No Search: Status equals
q[status_cont] string No Search: Status contains
q[processed_at_eq] string No Search: Processed at equals
q[processed_at_gteq] string No Search: Processed at greater than or equal to
q[processed_at_lteq] string No Search: Processed at less than or equal to
q[delivered_at_eq] string No Search: Delivered at equals
q[delivered_at_gteq] string No Search: Delivered at greater than or equal to
q[delivered_at_lteq] string No Search: Delivered at less than or equal to
q[bounced_at_eq] string No Search: Bounced at equals
q[bounced_at_gteq] string No Search: Bounced at greater than or equal to
q[bounced_at_lteq] string No Search: Bounced at less than or equal to
q[bounce_category_eq] string No Search: Bounce category equals
q[bounce_category_cont] string No Search: Bounce category contains
q[soft_bounced_at_eq] string No Search: Soft bounced at equals
q[soft_bounced_at_gteq] string No Search: Soft bounced at greater than or equal to
q[soft_bounced_at_lteq] string No Search: Soft bounced at less than or equal to
q[s] string No 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
400 The request is invalid. Check the query parameters, including that per_page isn't above the maximum allowed for this resource.
401 The API key wasn't sent or is invalid
429 Too many requests. You have exceeded the rate limit, wait and try again later.
500 An internal error happened. Try again later.
404 Couldn't find record with provided ID.

Response fields

NameTypeDescription
id integer ID
subscriber_id integer Subscriber
email string Email
status string Status
created_at string Created at
processed_at string Processed at
delivered_at string Delivered at
bounced_at string Bounced at
bounce_category string Bounce category
bounce_message string Bounce message
soft_bounced_at string Soft bounced at
reported_as_spam boolean Reported as spam
used_credits integer Used credits
impressions array Impressions
clicks array Clicks
unsubscribe_events array Unsubscribe events

Response headers

NameTypeDescription
Per-Page integer Number of records returned per page.
Total integer Total number of records matching the request, ignoring pagination.
Link string RFC 5988 links to the first, prev, next and last pages. Only the applicable relations are included.