Mailrelay API Reference

Get SMTP emails

GET /smtp_emails

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.

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