Mailrelay API Reference

Add a new A/B test

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

Authentication

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

Add a new A/B test.

At least 10 subscribers are required to send it.

You have to choose the percentage of the subscribers that will receive the A/B test.

Example: if you use 20%, 10% will receive combination A and 10% will receive combination B. After the winning combination is selected, 80% of the subscribers will receive it.

It's also possible to perform an A/B test with 3 combinations. In this case, you have to set number_of_combinations to 3.

Parameters

NameTypeRequiredDescription
campaign_id integer Yes The campaign ID that will be used as a base for this A/B test
test_type string Yes Test type
number_of_combinations integer No Number of combinations
percentage integer Yes Which percentage of the subscribers should receive the A/B tests?
decide_with string Yes How should we decide which combination won? "manual" means that you will choose it manually
wait_time integer No 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"
wait_unit string No Wait unit
sender_a_id integer No Sender A ID. Required if test_type is "sender"
sender_b_id integer No Sender B ID. Required if test_type is "sender"
sender_c_id integer No Sender C ID. Required if test_type is "sender" and number_of_combinations is 3
subject_a string No Subject A. Required if test_type is "subject"
subject_b string No Subject B. Required if test_type is "subject"
subject_c string No Subject C. Required if test_type is "subject" and number_of_combinations is 3
target string No To whom would you like to send this A/B test?
segment_id integer No Segment
group_ids array No Group ids

Responses

StatusDescription
201 Success
400 The request is invalid. Check if the field names in the request and the request data is valid.
422 A validation error occurred. Check the response body for more information.
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