Mailrelay API Reference

Lists A/B tests

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

Authentication

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

Lists A/B tests.

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 100.

Parameters

NameTypeRequiredDescription
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[campaign_id_eq] integer No Search: The campaign ID that will be used as a base for this A/B test equals
q[campaign_id_gteq] integer No Search: The campaign ID that will be used as a base for this A/B test greater than or equal to
q[campaign_id_lteq] integer No Search: The campaign ID that will be used as a base for this A/B test 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 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
campaign_id integer The campaign ID that will be used as a base for this A/B test
test_type string Test type
percentage integer Which percentage of the subscribers should receive the A/B tests?
decide_with string How should we decide which combination won? "manual" means that you will choose it manually
wait_unit string Wait unit
wait_time integer How long should we wait until the winning combination is selected? Eg.: if you want to wait 2 days, set wait_time = 2 and wait_unit = "days"
number_of_combinations integer Number of combinations
winning_combination string Winning combination
sender_a_id integer Sender A ID. Required if test_type is "sender"
sender_b_id integer Sender B ID. Required if test_type is "sender"
sender_c_id integer Sender C ID. Required if test_type is "sender" and number_of_combinations is 3
subject_a string Subject A. Required if test_type is "subject"
subject_b string Subject B. Required if test_type is "subject"
subject_c string Subject C. Required if test_type is "subject" and number_of_combinations is 3
sent_campaign_a_id integer Sent campaign a
sent_campaign_b_id integer Sent campaign b
sent_campaign_c_id integer Sent campaign c
remaining_sent_campaign_id integer Remaining sent campaign
target string To whom would you like to send this A/B test?
segment_id integer Segment
group_ids array Group ids

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.