Mailrelay API Reference

Get the report of an automation by day or month

GET https://{account}/api/v1/automations/{id}/report

Authentication

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

Get how many messages an automation sent and how many were delivered, opened and clicked in each day or month of a period. The period can't be longer than 2 months by day or 2 years by month. Times and the days and months of the report are in UTC.

Parameters

NameTypeRequiredDescription
id integer Yes ID of the record
start_time string No Start time in UTC. Format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD HH:MM:SS. The default is 7 days ago
end_time string No End time in UTC. Format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD HH:MM:SS. The default is now
group_by string No Period of each item of the report
channel string No Use email to get sent_emails, delivered, impressions and clicks or sms to get sent_messages, delivered and clicks

Responses

StatusDescription
200 Success
404 Couldn't find record with provided ID.
401 The API key wasn't sent, is invalid or has expired
403 The API key or its user doesn't have permission to use this endpoint, or the request comes from an IP address the key doesn't allow.
429 Too many requests. You have exceeded the rate limit, wait and try again later.
500 An internal error happened. Try again later.
422 A validation error occurred. Check the response body for more information.

Response fields

NameTypeDescription
group_by string Period of each item of the report
dates array Days (YYYY-MM-DD) or months (YYYY-MM) of the report, in UTC. The other arrays have one item for each of them, in the same order
sent_emails array Sent emails in each day or month. Only returned for the email channel
sent_messages array Sent SMS in each day or month. Only returned for the sms channel
delivered array Delivered messages in each day or month
impressions array Impressions in each day or month. Only returned for the email channel
clicks array Clicks in each day or month