Mailrelay API Reference

Get SMTP emails

GET https://{account}/api/v1/smtp_emails

Authentication

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

Lists all smtp emails.

The default behavior is to only list smtp emails without additional information like clicks, impressions etc.

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.

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
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
include_smtp_tags boolean No Include smtp tags in the results
q[smtp_tag_eq] string No Search: Smtp tag equals
q[email_eq] string No Search: Email equals
q[email_cont] string No Search: Email contains
q[message_id_eq] string No Search: Message ID equals
q[message_id_cont] string No Search: Message ID contains
q[status_eq] string No Search: Status equals
q[status_cont] string No Search: Status contains
q[reported_as_spam_true] boolean No Search: Reported as spam is true
q[reported_as_spam_not_true] boolean No Search: Reported as spam is false
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[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.

Response fields

NameTypeDescription
id integer ID
subscriber_id integer Subscriber
email string Email
status string Status
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
updated_at string Updated at
reported_as_spam boolean Reported as spam
message_id string Message ID
sender_email string Sender
used_credits integer Used credits
impressions array Impressions
clicks array Clicks
unsubscribe_events array Unsubscribe events
smtp_tags array SMTP tags

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.