Mailrelay API Reference

Lists the activities of an automation

GET https://{account}/api/v1/automations/{automation_id}/activities

Authentication

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

Lists the activities of an automation. An activity is created each time a subscriber reaches a block, so a subscriber has one activity for each block they went through. Activities without finished_at are subscribers still waiting in that block.

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
automation_id integer Yes ID of the automation
automation_block_id integer No Only return the records of this block of the automation
q[finished_at_null] boolean No Search: set it to true to only return the subscribers that are still waiting in a block
page integer No Page number
per_page integer No Number of records per page
q[id_eq] integer No Search: ID equals
q[id_gteq] integer No Search: ID greater than or equal to
q[id_lteq] integer No Search: ID less than or equal to
q[subscriber_id_eq] integer No Search: Subscriber equals
q[subscriber_id_gteq] integer No Search: Subscriber greater than or equal to
q[subscriber_id_lteq] integer No Search: Subscriber less than or equal to
q[scheduled_time_eq] string No Search: When the block runs for the subscriber. For delays, it's when the wait ends equals
q[scheduled_time_gteq] string No Search: When the block runs for the subscriber. For delays, it's when the wait ends greater than or equal to
q[scheduled_time_lteq] string No Search: When the block runs for the subscriber. For delays, it's when the wait ends less than or equal to
q[finished_at_eq] string No Search: When the block ran for the subscriber or the activity was stopped. It's empty while the subscriber is waiting in the block equals
q[finished_at_gteq] string No Search: When the block ran for the subscriber or the activity was stopped. It's empty while the subscriber is waiting in the block greater than or equal to
q[finished_at_lteq] string No Search: When the block ran for the subscriber or the activity was stopped. It's empty while the subscriber is waiting in the block less than or equal to
q[stopped_reason_eq] string No Search: Why the activity was stopped before the block ran. It's empty when the activity wasn't stopped equals
q[stopped_reason_cont] string No Search: Why the activity was stopped before the block ran. It's empty when the activity wasn't stopped contains
q[created_at_eq] string No Search: When the subscriber reached the block equals
q[created_at_gteq] string No Search: When the subscriber reached the block greater than or equal to
q[created_at_lteq] string No Search: When the subscriber reached the block 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: "id 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, 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.
404 Couldn't find record with provided ID.

Response fields

NameTypeDescription
id integer ID
automation_block_id integer ID of the block that the subscriber reached
subscriber_id integer Subscriber
email string Email of the subscriber
sms_phone string SMS phone of the subscriber
scheduled_time string When the block runs for the subscriber. For delays, it's when the wait ends
finished_at string When the block ran for the subscriber or the activity was stopped. It's empty while the subscriber is waiting in the block
stopped_reason string Why the activity was stopped before the block ran. It's empty when the activity wasn't stopped
created_at string When the subscriber reached the block

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.