Mailrelay API Reference

Add a new A/B test

POST /ab_tests

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 numberofcombinations to 3.

Parameters

NameTypeDescription
campaign_id integer The campaign ID that will be used as a base for this A/B test
test_type string Test type
number_of_combinations integer Number of combinations
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_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"
wait_unit string Wait unit
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
target string To whom would you like to send this A/B test?
segment_id integer Segment
group_ids array 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
500 An internal error happened. Try again later.