POST method must be used for this query.


All parameters must be URL encoded.




An array of campaigns, which will be part of the A/B split test. Required. See also “Structure of the parameter splits”.


List or lists of subscribers the campaign is being sent to. IDs of filters in Smaily > Subscribers. Required. See also List user-made filters.


A percentage taken from unique subscribers, contained in lists obtained from the parameter list, which is divided equally between all the splits specified in the array of parameter splits. See an example calculation at “Finding the number of subscribers”. Required.


Winning condition, which will be used to select the best-performing split. Possible values are openrate, clicks, views, unsubscribed. Default is clicks.


Due date to send out a campaign to the rest of the list with the best-performing split options. Value must be formatted as date-time (“YYYY-MM-DD HH:MM:SS”). If no value is set, wrong formatting is used of the specified date-time is in the past, query will be stopped. Required.

Structure of the parameter splits




Email subject. Required. Text field.


Link to HTML content, which needs to be in a publicly accessible URL. Required.


Link to plain-text content, which needs to be in a publicly accessible URL. Required.


Sender From address. Required. Must be added first in Smaily > Account profile.


Sender Name. Not required. If not set, default Name will be used from Smaily > Account profile.


Due date of the campaign split. Value must be formatted as date-time (“YYYY-MM-DD HH:MM:SS”). If no value is set, “now” will be used with a 5-minute “grace” period, if the campaign still needs to be cancelled, which can be done in Smaily > Campaigns. Due date must not be later than parameter win_at!


In addition to status code and message, field ID will be given with the response, which contains an ID of the campaign. With this parameter the statistics of the campaign can be obtained later.

Finding the number of subscribers

Let’s say that we want to test a campaign with two different subjects for link click performance on the lists “Estonian subscribers” and “Finnish subscribers”. The lists contain a total of 10 000 unique subscribers. We’ll use 20% of the lists for tests.

Number of subscribers getting the split A or B is 10 000 * 20% = 2 000.

Since the A/B split test campaign has 2 tests, number of subscribers participating in one split of the test is - 2 000 / 2 = 1 000.

Either test campaign will be sent to 1 000 random (unique) subscribers contained in the list “Estonian subscribers” or “Finnish subscribers”.

Example query:

Launching an A/B split test campaign

Query to launch an A/B split test campaign, which contains two splits. Tests will be sent to 10% of the list “Estonian subscribers”. 

$username = 'YOUR_USERNAME';
$password = 'YOUR_PASSWORD';
$location = 'https://<subdomain>';
$query = array(
  'splits' => array(
      'subject' => 'Head pakkumised - test (A)',
      'from' => '',
      'html' => '',
      'text' => '',
      'due' => '2014-06-18 07:00:00',
      'subject' => 'Head pakkumised - test (B)',
      'from' => '',
      'from_name' => 'API test',
      'html' => '',
      'text' => '',
      'due' => '2014-06-18 15:00:00',
  'list' => 7,
  'size' => 10,
  'win_at' => '2014-06-25 07:00:00',

// Query ($query) should be posted as following.
// In our example it will be taken care of by “http_build_query” function.
// splits%5B0%5D%5Bsubject%5D=Head+pakkumised+-+test+%28A%29&

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $location);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query));
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");

$result = curl_exec($ch);


Result for a successful query:


  'code': 101,
  'message': 'OK',
  'id': 1


See also other possible results from Possible results.