Suggest Edits

Introduction

 

This section details Split's API. The Split API uses resource-oriented URLs, uses status codes to indicate the success or failure of requests and returns JSON from all requests.

You can use the Split API to push data into Split, get data out of Split, build custom integrations, or build on top of the Split platform.

Getting Started?

If you're just getting started with Split, we encourage your to read our main documentation site. You'll learn how to set up our SDKs and release a feature without re-deploying your application.

Suggest Edits

Authentication

How to authenticate against the Split API

 

All requests to Split's API must be authenticated with an admin API key. The admin key type provides private and universal access to current and future admin APIs. Creating an API key is simple and can be done in the API Keys section of settings.

Learn more about API keys

To best familiarize yourself with using API keys in Split, visit our main documentation for more details.

Authentication Header

An authentication header must be added containing your API key for the request. Authenticate with the API by adding an authorization header containing your admin API key.

Authorization: Bearer ADMIN_API_KEY
Suggest Edits

Wrapper Client

 

For most of our supported languages, we provide a dedicated client that wraps our API functionality, providing an easy way to interact with Split from within your application. You can find these clients in our GitHub repository if you want to see the source code.

Each client is instantiated using an admin API key, as described in the previous section.

Current Support

At this time, not all API functionality is supported in wrapper clients. Complete functionality will be provided in future releases.

Import the Wrapper into Your App

To get started, import the SDK into your project in the language of your choice.

<dependency>
    <groupId>io.split.api</groupId>
    <artifactId>java-api</artifactId>
    <version>1.1.0</version>
</dependency>
composer require splitsoftware/split-api-client
# Gemfile
gem 'splitapi-rb'
npm install --save @splitsoftware/splitio-api@latest
pip install splitapiclient
Install-Package Splitio.Api
Install-Package Splitio.Api-net-core

Instantiate the Wrapper and Create a New Split API Client

import io.split.api.SplitApiClient;

SplitApiClient splitApiClient = SplitApiClient.client(adminToken);
$c = new \SplitIO\ApiClient\SplitApiClient(array(
    'apikey' => 'Admin'
));
client = SplitApi::Client.new(api_key: 'SPLIT_ADMIN_TOKEN')
var SplitAPI = require('@splitsoftware/splitio-api');

// You can instantiate your client with the new keyword, as it is a class
var ApiClient = new SplitAPI.client('your_admin_key', {
  // Your settings
});

// Or you can just call the function.
var ApiClient = SplitAPI.client('your_admin_key', {
  // Your settings
});
// Custom types and interfaces declarations are included on the NPM package under the SplitAPI namespace. 
// Feel free to dive into the declarations whenever intellisense is not enough, they have useful information!
const SplitAPI = require('@splitsoftware/splitio-api');

const apiSettings: SplitAPI.IApiConfig = {
  // Your settings
}

// You can instantiate your client with the new keyword, as it is a class
const ApiClient: SplitAPI.ApiClient = new SplitAPI.client('your_admin_key', apiSettings);

// Or you can just call the function.
const ApiClient: SplitAPI.ApiClient = SplitAPI.client('your_admin_key', apiSettings);
from splitapiclient.main import get_client

# instantiate client        
client = get_client({
    'apikey': 'Admin',
})
 String adminToken = “ANY ADMIN TOKEN”;
 var config = new SplitApiClientConfig();
 config.connectionTimeout = 40000;
 config.debugEnabled = false;
 SplitApiClient client =  new SplitApiClient(adminToken, config);
Suggest Edits

Rate Limiting

 

Our public API is guarded by a rate limiter using several techniques to prevent abuse. Calls to this API that are rate limited will return a 429 status code along with relevant headers that indicate the remaining quota (X-RateLimit-Remaining-Org and X-RateLimit-Remaining-IP) and how long to wait until the next window specified in seconds (X-RateLimit-Reset-Seconds-Org and X-RateLimit-Reset-Seconds-IP). When rate limited, users should retry after a number of seconds equal to or greater than the maximum time of the last two "X-RateLimit-Reset-Seconds-XXX" headers.

API rate limiting and SDKs

Rate-limiting only applies to this public API and does not affect the API used by the SDKs to serve feature evaluations.

Suggest Edits

Environments Overview

 

An environment reflects a stage in the development process, such as your production application or your internal staging environment. During the feature release process, Splits can be promoted through the various environments; allowing for a targeted roll out throughout the development process.

At this time the creation and editing of environments are limited to administrators within the Split application.

With the API you can get information about the environments that exist within your organization.

{
  "id": "string", // Server populated identifier
  "name": "string" // Display name
}
Environment environment = Environment.builder()
  .id("string") // Server populated identifier
  .name("string") // Display name
  .build();
use SplitIO\ApiClient\Resources\Environment;

// Passing an associative array to the constructor:
$env = new Environment(array(
  'id' => 'someId',    
  'name' => 'someName'
));

// Using setters:
$env = new Environment();
$env->setId('someId');
$env->setName('someName');
{
  "id": "string", # Server populated identifier
  "name": "string" # Display name
}
// Environments follow the IEnvironment interface.
interface IEnvironment {
  id: string; // Server populated identifier
  name: string; // Display name
}

// You can either work with an environment instance, using our exposed class:
var myEnv = new SplitAPI.entities.Environment({
  id: 'env_id',
  name: 'env_name'
});
// Or just use a plain object that complies with the interface
var myEnv = {
  id: 'env_id',
  name: 'env_name'
}

// Environments follow the IEnvironment interface.
interface IEnvironment {
  id: string; // Server populated identifier
  name: string; // Display name
}

// You can either work with an environment instance, using our exposed class:
const myEnv = new SplitAPI.entities.Environment({
  id: 'env_id',
  name: 'env_name'
});
// Or just use a plain object that complies with the interface:
const myEnv: SplitAPI.IEnvironment  = {
  id: 'env_id',
  name: 'env_name'
}
from splitapiclient.resources import Environment

# Passing a dict with values:
env = Environment({
    'id': 'someId',
    'name': 'someName',
})

# Using property setters
env = Environment()
env.id = 'someId'
env.name = 'someName'
var environment = new Environment() 
{
   id = "string", // Server populated identifier
   name = "string" // Display name
};
Suggest Edits

Get Environments

Get a list of environments.

 
gethttps://api.split.io/internal/api/v1/environments
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/environments
List<Environment> result = client.environments().list();
// Get environments
<?php
$client->environments()->listAll();
//-----------------
client.environments.list
ApiClient.environments.list().then(function(res) {
  // A collection of Environment instances
});
# get all environments
environments = client.environments.list()
var result = client.Environments().List();
A binary file was returned

You couldn't be authenticated

[ 
  {
    id: <string>,
    name: <string>
  },
  
]

{
  "code": 404,
}
 
Suggest Edits

Traffic Types Overview

 

A traffic type is a particular identifier type for any hierarchy of your customer base. Traffic types in Split are completely customizable and can be any database key you choose to send to Split, i.e. a user ID, account ID, IP address, browser ID, etc. Essentially, any internal database key you're using to track what "customer" means to you.

The creation and editing of traffic types are limited to administrators within the Split application.

With the API you can get information about the traffic types that exist within your organization.

Learn more about traffic types

To best familiarize yourself with using traffic types, visit our main documentation for more details.

{
  "id": "string", // Server populated identifier
  "name": "string", // Display name
  "displayAttributeId": "string" // (Optional) Attribute used for display name in UI
}
TrafficType trafficType = TrafficType.builder()
	.id(String) // Server populated identifier
  .name(String) // Display name
  .displayAttributeId(String) // (Optional) Attribute used for display name in UI
  .build();
<?php

use SplitIO\ApiClient\Resources\Attribute;

// Passing an associative array 
$attr = new Attribute(array(
  'id' => 'someId',
  'name' => 'someName',
  'displayAttributeId' => 'someDisplayAttributeId' // (Optional) Attribute used for display name in UI
));

// Using setter methods
$attr = new Attribute()
$attr->setId('id' => 'someId');
$attr->setName('someName');
$attr->setDisplayAttributeId('someDisplayAttributeId'); // (Optional) Attribute used for display name in UI
));
{
  "id": "string", # Server populated identifier
  "name": "string", # Display name
  "displayAttributeId": "string" # (Optional) Attribute used for display name in UI
}
// Traffic Types follow the ITrafficType interface.
interface ITrafficType {
  id: string; // Server populated identifier
  name: string; // Display name
  displayAttributeId?: string; // (Optional) Attribute used for display name in UI
}

// You can either work with a Traffic Type instance, using our exposed class:
var myTT = new SplitAPI.entities.TrafficType({
  id: 'tt_id',
  name: 'tt_name'
});
// Or just use a plain object that complies with the interface:
var myTT = {
  id: 'tt_id',
  name: 'tt_name'
};
// Traffic Types follow the ITrafficType interface.
interface ITrafficType {
  id: string; // Server populated identifier
  name: string; // Display name
  displayAttributeId?: string; // (Optional) Attribute used for display name in UI
}

// You can either work with a Traffic Type instance, using our exposed class:
const myTT = new SplitAPI.entities.TrafficType({
  id: 'tt_id',
  name: 'tt_name'
});
// Or just use a plain object that complies with the interface:
const myTT: SplitAPI.ITrafficType = {
  id: 'tt_id',
  name: 'tt_name'
};
from splitapiclient.resources import TrafficType

# Using dict with properties
tt = TrafficType({
    'id': 'someId',
    'name': 'someName',
    'displayAttributeId': 'someDisplayAttributeId' # (Optional) Attribute used for display name in UI
})

# Using property setters
tt = TrafficType()
tt.id = 'someId'
tt.name = 'someName'
tt.display_attribute_id = 'someDisplayAttributeId' # (Optional) Attribute used for display name in UI
var trafficType = new TrafficType() 
{
  id = "string", // Server populated identifier
  name = "string", // Display name
  displayAttributeId = "string" // (Optional) Attribute used for display name in UI
};
Suggest Edits

Get Traffic Types

Get a list of traffic types.

 
gethttps://api.split.io/internal/api/v1/trafficTypes
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes
List<TrafficType> result = client.attributes().list();
// Get trafficTypes
<?php
$client->trafficTypes()->listAll();
//-----------------
client.traffic_types.list
ApiClient.trafficTypes.list().then(function(res) {
  // A collection of Traffic Type instances.
});
# get all traffic types
traffic_types = client.traffic_types.list()
var result = client.TrafficTypes().List();
A binary file was returned

You couldn't be authenticated

[
	{
		id: <string>,
		name: <string>,
		displayAttributeId: <string>
	},
	
]
{
  "code": 404,
}
 
Suggest Edits

Attributes Overview

 

Attributes are properties of a customer id in Split. With the API you can get, save, and delete attributes programmatically.

Attribute fields are also created automatically when new customer identities are saved to Split. Those newly created attributes are created with an unknown data type and with no display or description information. It is recommended to customize and/or update your attributes to ensure each attribute has a data type and attribute description.

The data type is an optional parameter which is used for display formatting purposes. This parameter is not used to validate the values on inbound customer identities, but incorrectly typed data will be displayed as their raw string. The data types available include string, datetime, number, and set; this value can also be left null and the data will be treated as a string. Values for datetime fields are expected to be passed as milliseconds past the epoch. Values for set fields are expected to be passed in a string as comma separated values. If an unsupported data type is sent you will receive a 400 error code as a response.

{
  "id": "string", // Attribute identifier, same as used in identity value map
  "trafficTypeId": "string", // Traffic type this attribute is associated with
  "displayName": "string", // (Optional) How the attribute will be displayed in the UI, defaults to the id
  "description": "string", // (Optional) A description of the attribute
  "dataType": "string", // (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string. Must be one of: null, "string", "datetime", "number", "set"
  "isSearchable": boolean // (Optional) If the attribute should appear in segment and whitelist search
}
Attribute attribute = Attribute.builder()
  .id(String) // Attribute identifier, same as used in identity value map
  .trafficTypeId(String) // Traffic type identifier
  .trafficType(TrafficType) // OR: traffic type object
  .dataType(String) // (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string
  .displayName(String) // (Optional) How the attribute will be displayed in the UI, defaults to the id
  .description(String) // (Optional) A description of the attribute
  .isSearchable(Boolean) // (Optional) If the attribute should appear in segment and whitelist search
  .build();
<?php

use SplitIO\ApiClient\Resources\Attribute;

// Passing an associative array of properties
$attr = new Attribute(array(
  'id' => 'someId',
  'trafficTypeId' => 'someTrafficTypeId',
  'displayName' => 'someDisaplayName',
  'description' => 'someDescription',
  'dataType' => 'STRING',
  'isSearchable' => false
));

// Using setter methods
$attr = new Attribute();
$attr->setId('someId');
$attr->setTrafficTypeId('someTrafficTypeId');
$attr->setDisplayName('someDisaplayName');
$attr->setDescription('someDescription');
$attr->setDataType('STRING');
$attr->setIsSearchable(false);
{
  "id": "string", # Attribute identifier, same as used in identity value map
  "trafficTypeId": "string", # Traffic type this attribute is associated with
  "displayName": "string", # (Optional) How the attribute will be displayed in the UI, defaults to the id
  "description": "string", # (Optional) A description of the attribute
  "dataType": "string", # (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string
  "isSearchable": boolean # (Optional) If the attribute should appear in segment and whitelist search
}
// Attributes follow the IAttribute interface
interface IAttribute {
  id: string; // Attribute identifier, same as used in identity value map
  trafficTypeId: string; // Traffic type this attribute is associated with
  displayName?: string; // (Optional) How the attribute will be displayed in the UI, defaults to the id
  dataType?: string; // (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string
  description?: string; // (Optional) A description of the attribute
  isSearchable?: boolean; // (Optional) If the attribute should appear in segment and whitelist search
}

// You can either work with an attribute instance, using our exposed class:
var myAttribute = new SplitAPI.entities.Attribute({
  trafficTypeId: 'a_traffic_type_id',
  id: 'attr_id'
});
// Or just use a plain object that complies with the interface:
var myAttribute = {
  trafficTypeId: 'a_traffic_type_id',
  id: 'attr_id'
};
// Attributes follow the IAttribute interface
interface IAttribute {
  id: string; // Attribute identifier, same as used in identity value map
  trafficTypeId: string; // Traffic type this attribute is associated with
  displayName?: string; // (Optional) How the attribute will be displayed in the UI, defaults to the id
  dataType?: string; // (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string
  description?: string; // (Optional) A description of the attribute
  isSearchable?: boolean; // (Optional) If the attribute should appear in segment and whitelist search
}

// You can either work with an attribute instance, using our exposed class:
const myAttribute = new SplitAPI.entities.Attribute({
  trafficTypeId: 'a_traffic_type_id',
  id: 'attr_id'
});
// Or just use a plain object that complies with the interface:
const myAttribute: SplitAPI.IAttribute = {
  trafficTypeId: 'a_traffic_type_id',
  id: 'attr_id'
};
from splitapiclient.resources import Attribute

# Passing a dict with properrties
attr = Attribute({
    'id': 'someId',
    'trafficTypeId': 'someTrafficTypeId',
    'displayName': 'someDisplayName',
    'description': 'someDescription',
    'dataType': 'STRING',
    'isSearchable': False
})

# Using property setters
attr = Attribute()
attr.id = 'someId'
attr.traffic_type_id = 'someTrafficTypeId'
attr.display_name = 'someDisplayName'
attr.description = 'someDescription'
attr.dataType = 'STRING'
attr.isSearchable = False
var attribute = new Attribute()
{
  id = "string", // Attribute identifier, same as used in identity value map
  trafficTypeId = "string", // Traffic type this attribute is associated with
  displayName = "string", // (Optional) How the attribute will be displayed in the UI, defaults to the id
  description = "string", // (Optional) A description of the attribute
  dataType = "string" // (Optional) The data type of the attribute used for display formatting, defaults to displaying the raw string
  isSearchable = boolean; // (Optional) If the attribute should appear in segment and whitelist search
}
Suggest Edits

Get Attributes

Get a list of attributes via JSON for a traffic type ID.

 
gethttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/schema
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/schema
List<Attribute> result = client.attributes().list(trafficTypeId);
// Get all attributes for traffic type '1'
$attributes = $c->attributes()->listAll('1');
client.attributes.list('traffic_type_id')
ApiClient.attributes.list('a_traffic_type_id').then(function(res) {
  // The response would be list of Attribute instances, representing the attributes that belong to the specified Traffic Type
})
# Get Attributes
attributes = client.attributes.list('1') # trafficTypeId = '1'
var result = client.Attributes().List(trafficTypeId);
A binary file was returned

You couldn't be authenticated

[
	{
		id: <string>,
		trafficTypeId: <string>,
		displayName: <string>,
		description: <string>,
		dataType: <string>
	},
	...
]
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to fetch attributes from

 
Suggest Edits

Save Attribute

Save an attribute for a traffic type ID. The attribute is created if it does not exist and is overwritten completely if it does.

 
posthttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/schema
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/schema
Attribute result = client.attributes().save(
  Attribute.builder()
    .id("name")
    .trafficTypeId("trafficTypeId")
    .dataType("string")
    .displayName("Name")
    .build()
);
// Save attribute (Two alternatives, dict and instance)
// Alternative 1: using a dict with properties
<?php
$attr = $client->attributes()->save(array(
    'id' =>'1234',                         // Attribute id
    'trafficTypeId' =>'1',                 // traffic type Id
    'displayName' => 'display name 1234',  // Attribute display name
    'description' => 'description1234',    // Attribute description
    'dataType' => 'STRING',                // Attribute data type
    'isSearchable' => false                // is the attribute searchable?
));
// Alternative 2: Using setter methods
<?php
$client->attributes->save($attr); // Where $attr is an instance of SplitIO\ApiClient\Resources\Attribute.
client.attributes.save(
  id: "string",
  traffic_type_id: "string",
  display_name: "string",
  description: "string",
  data_type: "string"
)
var myAttribute = new SplitAPI.entities.Attribute({
  id: 'identifier',
  trafficTypeId: 'a_traffic_type_id'
});
ApiClient.attributes.create(myAttribute).then(function(res) {
  // The response would be an Attribute instance, with the data as it's on the BE.
});
# Save Attribute
# Alternative 1: (pasing a dict of properties)
new_attribute = client.attributes.save({
    'trafficTypeId': '1',
    'id': 'aa',
    'displayName': 'AA',
    'description': 'something about this attribute',
    'dataType': 'STRING',
    'isSearchable': False
})
# Alternative 2: (passing an Attribute instance)
client.attributes.save(attr)  # where attr is an instance of splitapiclient.resources.Attribute
var attribute = new Attribute() 
{ 
  id = "test", 
  displayName = "test", 
  description = "test", 
  dataType = "test", 
  trafficTypeId = "test" 
};
var result = client.Attributes().Create(attribute);
A binary file was returned

You couldn't be authenticated

[
	{
		id: <string>,
		trafficTypeId: <string>,
		displayName: <string>,
		description: <string>,
		dataType: <string>
	},
	...
]
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to fetch attributes from

 

Request format

Suggest Edits

Delete Attribute

Delete an attribute by its traffic type and attribute ID. This also removes any stored data for that attribute from all customer identities in Split.

 
deletehttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/schema/attribute_id
curl -v -X DELETE \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/schema/<ATTRIBUTE_ID>
boolean result = client.attributes().delete(trafficTypeId, attributeId);
<?php
try {
    // Alternative 1: by passing Ids
    $client->attributes()->delete($trafficTypeId, $attributeId);
    // Alternative 2: by passing an instance
    $client->attributes()->deleteByInstance($attr); // where $attr is an instance of SplitIO\ApiClient\Resources\Attribute.
} catch \SplitIO\ApiClient\Util\Exceptions\HTTPResponseException $e {
    logger->warn('Attribute not deleted');
}
client.attributes.delete('traffic_type_id', 'attribute_id')
ApiClient.attributes.delete(myAttribute).then(function(res) {
  // The response would be a boolean flag
});
# Delete an attribute
from splitapiclient.util.exceptions import HTTPResponseError
try:
    # Alternative 1 (passing ids)
    client.attributes.delete(
        'aa', # attribute id
        '1', # traffic type id
    )
    # Alternative 2 (passing an Attribute instance)
    client.attributes.delete_by_instance(attr)  # where attr is an instance of splitapiclient.resources.Attribute
except HTTPResponseError:
    logger.warn('Attribute not deleted')
var result = client.Attributes().Delete(trafficTypeId, attributeId);
A binary file was returned

You couldn't be authenticated

true
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to delete the attribute from.

attribute_id
string
required

The ID of the attribute to delete.

 
Suggest Edits

Customer Identities Overview

 

You can populate your customer identities within Split to enrich and simplify the experience when using the Split web console. Learn more about using this data in Split.

Your customer ids and information are used to help search for customers during segment and whitelist creation as well when navigating impressions for any Split.

With the API you can save, update and delete customer identities programmatically.

{
  key: "string", // Key used for getTreatment() calls
  trafficTypeId: "string", // Traffic Type Identifier
  environmentId: "string", // Environment Identifier
  values: { // Attribute Values (key: Attribute Id, value: value)
    key: "string",
    ...
  }
}
Identity identity = Identity.builder()
  .key(String)                // Key used for getTreatment() calls
  .trafficTypeId(String)      // Traffic type identifier
  .trafficType(TrafficType)   // OR: Traffic type object
  .environmentId(String)      // Environment identifier
  .environment(Environment)   // OR: Environment object
  .timestamp(long)            // (Optional) Time of last update
  .values(Map<String,String>) // Attribute values (key: Attribute ID, value: value)
  .build();
<?php

use SplitIO\ApiClient\Resources\Identity;

$id1 = new Identity(array(
  'key' => 'someKey',
  'trafficTypeId' => 'someTrafficTypeId',
  'environmentId' => 'someEnvironmentId',
  'values' => array(
    'attribute1' => 'value1',
    'attribute2' => 'value2'
  )
))
  
$id1 = new Identity();
$id1->setKey('someKey');
$id1->setTrafficTypeId('someTrafficTypeId');
$id1->setEnvironmentId('someEnvironmentId');
$id1->setValues(array(
  'attribute1' => 'value1',
  'attribute2' => 'value2'
));


    
{
  key: "string", # Key used for getTreatment() calls
  trafficTypeId: "string", # Traffic type identifier
  environmentId: "string", # Environment identifier
  values: { # Attribute Values (key: Attribute ID, value: value)
    key: "string",
    ...
  }
}
// Identities follow the IIdentity interface
interface IIdentity {
  key: string; // Key used for getTreatment() calls
  environmentId: string; // Environment identifier
  trafficTypeId: string; // Traffic type identifier
  organizationId?: string; // (Optional) Organization identifier
  timestamp?: number; // (Optional) Time of last update
  values?: { // Attribute Values (key: Attribute ID, value: value)
    [key: string]: string
  };
}

// You can either work with an identity instance, using our exposed class:
var myIdentity = new SplitAPI.entities.Identity({
  key: 'a_key', 
  environmentId: 'env_id', 
  trafficTypeId: 'tt_id', 
  values: { 
    'email': 'mail@gmail.com'
  }
});
// Or just use a plain object that complies with the interface:
var myIdentity = {
  key: 'a_key', 
  environmentId: 'env_id', 
  trafficTypeId: 'tt_id', 
  values: { 
    'email': 'mail@gmail.com'
  }
};
// Identities follow the IIdentity interface
interface IIdentity {
  key: string; // Key used for getTreatment() calls
  environmentId: string; // Environment Identifier
  trafficTypeId: string; // Traffic type Identifier
  organizationId?: string; // (Optional) Organization identifier
  timestamp?: number; // (Optional) Time of last update
  values?: { // Attribute values (key: Attribute ID, value: value)
    [key: string]: string
  };
}

// You can either work with an identity instance, using our exposed class:
const myIdentity = new SplitAPI.entities.Identity({
  key: 'a_key', 
  environmentId: 'env_id', 
  trafficTypeId: 'tt_id', 
  values: { 
    'email': 'mail@gmail.com'
  }
});
// Or just use a plain object that complies with the interface:
const myIdentity: SplitAPI.IIdentity = {
  key: 'a_key', 
  environmentId: 'env_id', 
  trafficTypeId: 'tt_id', 
  values: { 
    'email': 'mail@gmail.com'
  }
};
from splitapiclient.resources import Identity

# Passing a dict of properties to the constructor
id1 = Identity({
    'key': 'someKey',
    'trafficTypeId': 'someTrafficTypeId',
    'environmentId': 'someEnvironmentId',
    'values': {
        'attribute1': 'value1',
        'attribute2': 'value2',
    }
})

# Using property setters
id1 = Identity()
id1.key = 'someKey'
id1.traffic_type_id = 'someTrafficTypeId'
id1.environment_id = 'someEnvironmentId'
id1.values = {
  'attribute1': 'value1',
  'attribute2': 'value2',
}
var values = new Dictionary<string, string>();
values.Add("attribute id", "value");
var identity = new Identity() 
{ 
  key = "key", // Key used for getTreatment() calls
  environmentId = "environmentId", // Environment identifier
  trafficTypeId = "trafficTypeId", // Traffic type identifier
  values = values // Attribute values (key: Attribute ID, value: value)
};
Suggest Edits

Save Customer Identity

Create or overwrite a single customer ID for a given traffic type and environment.

 
posthttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/environments/environment_id/identities/key
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -d '{ key: <string: key>, values: { <string: attribute_id>: <string: value>, ... } }' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/environments/<ENVIRONMENT_ID>/identities/<KEY>
Identity result = client.identities().save(
  Identity.builder()
    .key("key")
    .trafficTypeId("trafficTypeId")
    .environmentId("environmentId")
    .addValue("attribute_id","value")
    .build()
);
// Save a customer identity
// Alternative 1 (passing an array with properties):
<?php
$identity = $client->identities()->save(array(
    'key' => 'k1',                       // identity key
    'trafficTypeId' => '1',                        // traffic type id
    'environmentId' => '1',                        // environment id
    'values' => array('asd' => 1),          // identity values
    'organizationId' => 'org1'                      // organization id
));
// Alternative 2 (passing an Identity instance):
$client->save($identity); // Where $identity is an instance of SPlitIO\ApiClient\Resources\Identity 
client.identities.save({
  traffic_type_id: "string",
  environment_id: "string",
  key: "string",
  values: {
    attribute_id: "value"
  }
})
var myIdentity = new SplitAPI.entities.Identity({
  key: 'key',
  environmentId: 'environmentId',
  trafficTypeId: 'trafficTypeId',
  values: {
    'attribute_id': 'value'
  }
});
ApiClient.identities.save(myIdentity).then(function(res) {
  // The response would be an Identity instance, with the data as it's on the BE.
});
# Alternative 1: (passing a dict of properties)
client.identities.save({
    'trafficTypeId': '1',
    'environmentId': '1',
    'key': 'key_abc',
    'values': {'a1': 'qwe'}
})
# Alternative 2: (passing an Identity instance)
client.identities.save(identity)  # where identity is an instance of splitapiclient.resources.Identity
var values = new Dictionary<string, string>();
values.Add("test_attr", "test_val");
var identity = new Identity() 
{ 
  environmentId = "test", 
  key =  "test", 
  trafficTypeId = "test",
  values = values 
};
var result = client.Identities().Save(identity);
A binary file was returned

You couldn't be authenticated

{
	key: <string: key>,
	trafficTypeId: <string: type id>,
	environmentId: <string: environment id>,
	values: {
		<string: attribute_id>: <string: value>,
		...
	}
}
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to add the Identities within.

environment_id
string
required

The ID of the environment to add the identities within.

key
string
required

The key used for getTreatment calls for the object this identity represents

 
Suggest Edits

Save Customer Identities

Create or overwrite customer identities for a given traffic type and environment.

 
posthttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/environments/environment_id/identities
curl -v -X POST \
  -H 'Content-Type:application/json' \
  -d '[{ key: <string: key>, values: { <string: attribute_id>: <string: value>, ... } }, ... ]' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/environments/<ENVIRONMENT_ID>/identities/
List<Identity> identities = new ArrayList<>();
identities.add(
  Identity.builder()
    .key("key")
    .trafficTypeId("trafficTypeId")
    .environmentId("environmentId")
    .addValue("attribute_id","value")
    .build()
);
ResultDTO<Identity> result = client.identities().saveAll(identities);
// Save customer identities:
// Alternative 1 (passing an array of arrays of properties)
<?php
$identities = $client->identities()->saveAll(array(
    array(
        'trafficTypeId' => '1',
        'environmentId' => '1',
        'key' => 'key1',
        'values' => array('asd' =>'a', 'qwe' => 'b'),     // identity 1 array(key => array(attribute => value))
    ),
    array(
        'trafficTypeId' => '1',
        'environmentId' => '1',
        'key' => 'key2',
        'values' => array('asd' =>'c', 'qwe' => 'd'),     // identity 1 array(key => array(attribute => value))
    ),    
));
// Alternative 2 (passing an array of Identity instances)
$identities = $client->identities()->saveAll(array($i1, $i2)); // Where $i1 and $i2 are instances of SplitIO/ApiClient/Resources/Identity
client.identities.save_all("traffic_type_id", "environment_id",
  [
    {
      trafficTypeId: "string",
      environmentId: "string",
      key: "string",
      values: {
        attribute_id: "value"
      }
    },
    # ...
  ]
)
ApiClient.identities.saveBulk([myIdentity, anotherIdentity]).then(function(res) {
  // Do something with the saved identities
});
# Save Identities:
# Alternative 1 (passing a list of dicts with identity properties):
result = client.identities.save_all([
    {
        'trafficTypeId': '1',
        'environmentId': '2',
        'key': 'key1',
        'values': {'a1': 'a', 'a2': 'b'},
    },
    {
        'trafficTypeId': '1',
        'environmentId': '2',
        'key': 'key1',
        'values': {'a1': 'c', 'a2': 'd'},
    },
])
# Alternative 2 (passing a list of Identity objects)
result = client.identities.save_all([i1, i2])  # where i1 and i2 are instances of splitapiclient.resources.Identity
var values = new Dictionary<string, string>();
values.Add("test_attr", "test_val");
var identity = new Identity() 
{ 
  environmentId = "test", 
  key =  "test", 
  trafficTypeId = "test",
  values = values 
};
List<Identity> identities = new List<Identity>(); 
identities.Add(identity);
var result = client.Identities().Save(identities);
A binary file was returned

You couldn't be authenticated

{
  objects: [ 
    {
      key: <string: key>,
      trafficTypeId: <string: type id>,
      environmentId: <string: environment id>,
      values: {
        <string: attribute_id>: <string: value>,
        ...
      }
    },
    
  ]
}
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to add the identities within.

environment_id
string
required

The ID of the environment to add the identities within.

 
Suggest Edits

Update Customer Identity

Update a single customer ID for a given traffic type and environment. Any provided attribute values will be overwritten, but existing values will otherwise remain.

 
patchhttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/environments/environment_id/identities/key
curl -v -X PATCH \
  -H 'Content-Type:application/json' \
  -d '{ key: <string: key>, values: { <string: attribute_id>: <string: value>, ... } }' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/environments/<ENVIRONMENT_ID>/identities/<KEY>
Identity result = client.identities().update(
  Identity.builder()
    .key("key")
    .trafficTypeId("trafficTypeId")
    .environmentId("environmentId")
    .addValue("attribute_id","value")
    .build()
);
// Update an identity: 
// Alternative 1 (passing an array of properties):
<?php
$identity = $client->identities()->update(array(
    'key' => 'k1',                       // identity key
    'trafficTypeId' => '1',                        // traffic type id
    'environmentId' => '1',                        // environment id
    'values' => array('asd' => 1),          // identity values
    'organizationId' => 'org1'                      // organization id
));
// Alternative 2 (passing an Identity instance):
$client->update($identity); // Where $identity is an instance of SPlitIO\ApiClient\Resources\Identity
client.identities.update({
  traffic_type_id: "string",
  environment_id: "string",
  key: "string",
  values: {
    key: "value"
  }
})
var myIdentity = new SplitAPI.entities.Identity({
  key: 'a_key',
  environmentId: 'env_id',
  trafficTypeId: 'tt_id',
  values: {
    'email': 'mail@gmail.com'
  }
});
ApiClient.identities.update(myIdentity).then(function(res) {
  // The response would be an Identity instance, with the data as it's on the BE.
});
# Update Identity:
# Alternative 1 (passing a dict with properties):
client.identities.update({
    'trafficTypeId': '1',
    'environmentId': '1',
    'key': 'key_abc',
    'values': {'a1': 'qwe2'}
})
# Alternative 2 (passing an Identity instance):
client.identities.update(i1)  # where i1 is an instance of splitapiclient.resources.Identity
var values = new Dictionary<string, string>();
values.Add("test_attr", "test_val");
var identity = new Identity() 
{ 
  environmentId = "test", 
  key =  "test", 
  trafficTypeId = "test",
  values = values 
};
var result = client.Identities().Update(identity);
A binary file was returned

You couldn't be authenticated

{
	key: <string: key>,
	trafficTypeId: <string: type id>,
	environmentId: <string: environment id>,
	values: {
		<string: attribute_id>: <string: value>,
		...
	}
}
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to add the identities within.

environment_id
string
required

The ID of the environment to add the identities within.

key
string
required

The key used for getTreatment calls for the object this identity represents

 
Suggest Edits

Delete Customer Identity

Delete a customer ID from a given traffic type and environment.

 
deletehttps://api.split.io/internal/api/v1/trafficTypes/traffic_type_id/environments/environment_id/identities/key
curl -v -X DELETE \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/trafficTypes/<TRAFFIC_TYPE_ID>/environments/<ENVIRONMENT_ID>/identities/<KEY>
boolean result = client.identities().delete(trafficTypeId, environmentId, key);
// Delete an identity:
<?php
try {
    // Alternative 1 (passing ids and key)
    $client->identities()->delete($trafficTypeId, $environmentId, $key);
    // Alternative 2 (pasing an Identity instance)
    $client->identities()->deleteByInstance($identity); // Where $identity is an instance of SplitIO\ApiClient\Resources\Identity
} catch \SplitIO\ApiClient\Util\Exceptions\HTTPResponseException $e {
    logger->warn('Identity not deleted');
}
client.identities.delete("traffic_type_id", "environment_id", "key")
ApiClient.identities.delete(trafficTypeId, environmentId, key).then(function(res) {
  // The response would be a boolean flag, indicating the result of the operation
});
# Delete an identity:
from splitapiclient.util.exceptions import HTTPResponseError
try:
    # Alternative 1
    client.identities.delete(
        '1', # traffic type id
        '1', # environment id
        'key_abc' # identity key
    )
    # Alternative 2
    client.identities.delete_by_instance(i1)  # where i1 is an instance of splitpiclient.resources.Attribute
except HTTPResponseError:
    logger.warn('Identity not deleted')
var result = client.Identities().Delete(trafficTypeId, environmentId, key);
A binary file was returned

You couldn't be authenticated

true
{
  "code": 404,
}

Path Params

traffic_type_id
string
required

The ID of the traffic type to delete the Attribute from

environment_id
string
required

The ID of the environment to add the Identities within.

key
string
required

The key used for getTreatment calls for the object this identity represents

 
Suggest Edits

Segments Overview

 

The Rest API allows you to manage your Segments programmatically.

Using this API you can get Segments, as well as update a Segments keys in an environment.

Learn more about segments

To best familiarize yourself with using Segments in your deployment and rollout strategy, visit our main documentation for more details.

 

Below is the configuration for a Segment in a specific environment such as production or staging.

Note that Segments can be configured differently for each environment.

{
    "name": String,
    "environment": { "id": String, "name": String }, 
    "trafficType": { "id": String, "name": String }, 
    "creationTime": Number 
}
Suggest Edits

List Segments in Environment

Retrieves the Segments given an environment.

 
gethttps://api.split.io/internal/api/v1/segments/environments/environment_id_or_name
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/segments/environments/Production
A binary file was returned

You couldn't be authenticated

{
    "objects": [
      	{
          	"name":"demo",
          	"environment": { ... },
          	"trafficType": { ... },
          	"creationTime":1493920102896
        },
        { ... }
    ],
    "offset": 0,
    "limit": 20,
    "totalCount": N
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error listing segments for environment Production",
    "transactionId": "9ofcp0yvpb"
}
{
    "code": 404,
    "message": "Could not find environment Production",
    "transactionId": "9ofdd0bn9m"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want get the segments

Query Params

offset
int32

The offset to retrieve. Useful for pagination

limit
string

The maximum segments to return per call. Max=50.

 

JSON Received

{
    "objects": [ SEGMENT_IN_ENVIRONMENT ], // Array of Segments returned
    "offset": Number, // Offset received
    "limit": Number, // Limit received
    "totalCount": Number // Total number of Segments for the environment
}
Suggest Edits

Update Segment Keys in Environment via CSV

Bulk upload a CSV file containing a list of identifiers. The segment must exist before calling this endpoint.

 
puthttps://api.split.io/internal/api/v1/segments/environment_id/segment_name/upload?replace=false
curl -v -X PUT \
	-F "file=@/tmp/segments.csv" \
	-H 'Authorization: Bearer ADMIN_API_KEY' \
	https://api.split.io/internal/api/v1/segments/<ENVIRONMENT_ID>/segment_1/upload
A binary file was returned

You couldn't be authenticated

{
  "id": "dcaf31f0-ce9b-11e5-b8fa-6ee57757bd75",
  "orgId": "9b3df640-9adc-11e5-a8b2-aa398de8870a",
  "environment": "9dee9750-9adc-11e5-a8b2-aa398de8870a",
  "name": "segment_1",
  "trafficTypeId": "u",
  "trafficTypeURN": {
    "type": "TRAFFIC_TYPE",
    "id": "u",
    "name": "user"
  },
  "description": "Created by API",
  "creator": {
    "type": "System",
    "id": "Root",
    "name": "split.io"
  },
  "status": "ACTIVE",
  "creationTime": 1454960452239,
  "lastUpdateTime": 1454960453619,
  "iAmInThisSegment": null
}
{
  "code": 404,
  "message": "There is no segment with name $segment_name in environment $environment_id"
}

Path Params

environment_id
string
required

The id of the environment to upload the segment to

segment_name
string
required

The name of the segment you want to create

Query Params

replace
boolean

Replace the content of the segment (if it previously exists) with the new content

Form Data

file
string

The location of the file to upload

 
Suggest Edits

Update Segment Keys in Environment via JSON

Bulk upload a list of identifiers via JSON to a segment. The segment must exist before calling this endpoint.

 
puthttps://api.split.io/internal/api/v1/segments/environment_id/segment_name/upload?replace=false
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -d '["id1", "id2", "id3"]' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/segments/<ENVIRONMENT_ID>/segment_1/upload
A binary file was returned

You couldn't be authenticated

{
  "id": "dcaf31f0-ce9b-11e5-b8fa-6ee57757bd75",
  "orgId": "9b3df640-9adc-11e5-a8b2-aa398de8870a",
  "environment": "9dee9750-9adc-11e5-a8b2-aa398de8870a",
  "name": "segment_1",
  "trafficTypeId": "u",
  "trafficTypeURN": {
    "type": "TRAFFIC_TYPE",
    "id": "u",
    "name": "user"
  },
  "description": "Created by API",
  "creator": {
    "type": "System",
    "id": "Root",
    "name": "split.io"
  },
  "status": "ACTIVE",
  "creationTime": 1454960452239,
  "lastUpdateTime": 1454960453619,
  "iAmInThisSegment": null
}
{
  "code": 404,
  "message": "There is no segment with name $segment_name in environment $environment_id"
}

Path Params

environment_id
string
required

The id of the environment to upload the segment to

segment_name
string
required

The name of the segment you want to create

Query Params

replace
boolean

Replace the content of the segment (if it previously exists) with the new content

 

Request format

["id_1", "id_2", "id_3", .... ]
Suggest Edits

Get Segment Keys in Environment

Retrieve segments keys for a given existing segment.

 
gethttps://api.split.io/internal/api/v1/segments/environment_id/segment_name/keys
curl -v -X GET \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/segments/<ENVIRONMENT_ID>/segment_1/keys
A binary file was returned

You couldn't be authenticated

{
  "keys": [
    {
      "key": "key_1"
    },
    {
      "key": "key_2"
    },
    {
      "key": "key_3"
    },
    {
      "key": "key_4"
    },
    {
      "key": "key_5"
    }
  ],
  "count": 200,
  "offset": 5,
  "limit": 5
}
{
  "code": 404,
  "message": ""
}

Path Params

environment_id
string
required

The id of the environment to read segment keys from

segment_name
string
required

The name of the segment you want to fetch keys from

Query Params

offset
int32

The offset to retrieve. Useful for pagination

limit
int32

The maximum keys to return per call. Max=100.

 
Suggest Edits

Remove Segment Keys from Environment

Delete a list of segment keys via JSON from an existing segment.

 
puthttps://api.split.io/internal/api/v1/segments/environment_id/segment_name/deleteKeys
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -d '["id1", "id2", "id3"]' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/segments/<ENVIRONMENT_ID>/segment_1/deleteKeys
A binary file was returned

You couldn't be authenticated

{
  "code": 200,
  "message": ""
}
{
  "code": 404,
  "message": "There is no segment with name $segment_name in environment $environment_id"
}

Path Params

environment_id
string
required

The id of the environment to delete segment keys from

segment_name
string
required

The name of the segment you want to delete keys from

 

Request format

["id_1", "id_2", "id_3", .... ]
Suggest Edits

Splits Overview

 

The Rest API allows you to manage your Splits programmatically.

Using this API, you can create, get, delete Splits, as well as update a Split's targeting definition in an Environment.

The Split API is only available for our Beta Customers. If you would like to participate in the early release, please contact support@split.io.

Learn more about Splits

To best familiarize yourself with using Splits in your deployment and rollout strategy, visit our main documentation for more details

A Split is our term for a feature flag, toggle, or experiment. In REST terms it has the following schema:

{
    "name": String,
    "description": String, 
    "trafficType": { "id": String, "name": String }, 
    "creationTime": Number 
}

The REST Endpoints available for a Split are:

It's worth noting that this object does not contain any information regarding the configuration or rollout plan for any specific environment.

In the same way as the web console, creating a Split involves setting a name and a traffic type (and possibly a description).

After the Split is created, it is possible to update it for any specific environment, using the REST API calls for Split Definition.

Suggest Edits

Split Definition

 

A Split Definition is the configuration of a Split in a specific environment such as production or staging.

{
	“name”: String,
	“environment”: { "id": String, "name": String },
  "trafficType": { "id": String, "name": String },
	“killed”: Boolean,
	“treatments”: [ Treatment ],
	“defaultTreatment”: String,
	“trafficAllocation”: Number,
	“rules”: [ Rule ], 
	“defaultRule”: [ Bucket ],
	“creationTime”: Number,
	“lastUpdateTime”: Number,
}

The minimum required fields for configuring a Split Definition are treatments, defaultTreatment, and defaultRule.

For detailed examples on how to perform actions on a Split Definition, check:

Suggest Edits

Treatment

 

A treatment is a state of a Split. A simple feature flag has two treatments: on and off. An experiment can have any number of treatments.

{
  “name”: String,
  “description”: String,
  “keys”: [ String ],
  “segments”: [ String ]
}

Keys are used to show the specified treatment for a specific customer. It is analogous to the Whitelist section on the Web Console.

In the same way, Segments is used to show the treatment to users in a particular segment.

A Rule consists of a Condition and a list of Buckets.

When the Split Definition is evaluated, if the Condition of this Rule is met, then the customer will be evaluated and fall in the sticky distribution specified in the Buckets

{
  “condition”: Condition,
  “buckets”: [ Bucket ]
}

Note that you do not need to provide all treatments for each rule, however, the sum of treatment sizes in a single Rule must be 100.

Suggest Edits

Condition

 

A Condition consists of different Matchers. A customer satisfies a Condition only of it satisfies all the Matchers.

{
  “combiner”: "AND",
  “matchers”: [ Matcher ]
}

Note that when configuring or updating a `Split Definition, there is no need to specify the combiner, since for now, Split only allows AND combiner.

A bucket represents a sticky distribution of customers into treatments of a Split.

{
  “treatment”: String,
  “size”: Number
}
 

A Matcher represents the logic for selecting a specific subset of your customer population.

{
  “negate”: Boolean,
  “type”: MatcherType,
  “attribute”: String,
  "string": String,
  "bool" : Boolean,
  "strings" : [ String ],
  "number" : Number,
  "date" : Number,
  "between": { "from" : Number, "to" : Number },
  "depends": { "splitName": String, "treatment": String }
}

Note that depending on the type, different fields are required. All the rest of the fields do not need to be set.

If a field that is not used by the type is set, it will be ignored.

Suggest Edits

Matcher Type

 

Split supports the following Matcher Types.

{
  IN_SEGMENT,
  
  EQUAL_SET,
  ANY_OF_SET,
  ALL_OF_SET,
  PART_OF_SET,

  ON_DATE,
  ON_OR_AFTER_DATE,
  ON_OR_BEFORE_DATE,
  BETWEEN_DATE,

  BOOLEAN,
  
  EQUAL_NUMBER,
  LESS_THAN_OR_EQUAL_NUMBER,
  GREATER_THAN_OR_EQUAL_NUMBER,
  BETWEEN_NUMBER,

  IN_LIST_STRING,
  STARTS_WITH_STRING,
  ENDS_WITH_STRING,
  CONTAINS_STRING,
  MATCHES_STRING,
  
  IN_SPLIT,
}

IN_SEGMENT

When using this type, the matcher selects the set of customers that fall within a Segment.

Fields

string: Mandatory.
negate: Optional.

EQUAL_SET

This matcher selects customers with a multi-valued attribute equal to a Set of provided String literals. Since this is a Set based matcher, the order of the Set does not matter.

Fields

strings: Mandatory.
attribute: Mandatory
negate: Optional.

ANY_OF_SET

This matcher selects customers with a multi-valued attribute containing any of a Set of provided String literals. Since this is a Set based matcher, the order of the Set does not matter.

Fields

strings: Mandatory.
attribute: Mandatory
negate: Optional.

ALL_OF_SET

This matcher selects customers with a multi-valued attribute containing every String literal in a provided Set. Since this is a Set based matcher, the order of the Set does not matter.

Fields

strings: Mandatory.
attribute: Mandatory
negate: Optional.

PART_OF_SET

This matcher selects customers with a multi-valued attribute that is a subset of a Set of values. Since this is a Set based matcher, the order of the Set does not matter.

Fields

strings: Mandatory.
attribute: Mandatory
negate: Optional.

ON_DATE

The ‘is on’ matcher is helpful for doing date equalities. Note that this matcher drops the time component of a DateTime when doing the comparison. Thus, the values 1457382451 and 1457382452 fall on the same date even though they represent different times.

Fields

date: Mandatory. Milliseconds since epoch.
attribute: Mandatory
negate: Optional.

ON_OR_AFTER_DATE

The ‘on or after date’ matcher is helpful for targeting customers that performed an action after a given time. As an example, you can use this matcher to target customers that registered or bought something after a certain time.

Note that this matcher ignores time fields smaller than minutes. Specifically; seconds, milliseconds, and nanoseconds are ignored when doing the comparison. In other words, you can compare dates down to the minute field.

Thus, the values 1457382451 and 1457382471 will be equal to one another, even though they represent different seconds.

Fields

date: Mandatory. Milliseconds since epoch.
attribute: Mandatory
negate: Optional.

ON_OR_BEFORE_DATE

The ‘on or before date’ matcher is helpful for targeting customers that performed an action before a given time. As an example, you can use this matcher to target customers that registered or bought something before a certain time.

Note that this matcher ignores time fields smaller than minutes. Specifically; seconds, milliseconds, and nanoseconds are ignored when doing the comparison. In other words, you can compare dates down to the minute field.

Thus, the values 1457382451 and 1457382471 will be equal to one another, even though they represent different seconds.

Fields

date: Mandatory. Milliseconds since epoch.
attribute: Mandatory
negate: Optional.

BETWEEN_DATE

This matcher is an AND between ON_OR_AFTER_DATE and ON_OR_BEFORE_DATE. The same rules of ignoring time fields smaller than seconds apply.

Fields

between: Mandatory. It is an object that contains two fields, from and to. Both fields
are dates represented by milliseconds since epoch.
attribute: Mandatory
negate: Optional.

BOOLEAN

This is a self-explanatory matcher. At least, we think so :-).

Fields

bool: Mandatory.
attribute: Mandatory
negate: Optional.

EQUAL_NUMBER

This matcher selects the subset of customers that have an attribute equal to a numeric value.

Fields

number: Mandatory.
attribute: Mandatory
negate: Optional.

LESS_THAN_OR_EQUAL_NUMBER

This matcher selects the subset of customers that have an attribute that is less than or equal to a numeric value.

Fields

number: Mandatory.
attribute: Mandatory
negate: Optional.

GREATER_THAN_OR_EQUAL_NUMBER

This matcher selects the subset of customers that have an attribute that is greater than or equal to a numeric value.

Fields

number: Mandatory.
attribute: Mandatory
negate: Optional.

BETWEEN_NUMBER

A matcher of this type will match if the received number is between the two ones specified.

Fields

between: Mandatory. It is an object that contains two fields, from and to.
attribute: Mandatory
negate: Optional.

IN_LIST_STRING

This matcher selects customers with an attribute or key that falls within a whitelist. The whitelist is encoded within the strings field. This matcher is case sensitive.

Fields

strings: Mandatory.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

STARTS_WITH_STRING

This matcher selects customers with an attribute or key starting with any of a list of strings. This matcher is case sensitive. Note that the strings should not be regex patterns, they are string literals that are used for exact prefix matching.

Fields

strings: Mandatory.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

ENDS_WITH_STRING

This matcher selects customers with an attribute or key ending with any of a list of strings. This matcher is case sensitive. Note that the strings should not be regex patterns, they are string literals that are used for exact suffix matching.

Fields

strings: Mandatory.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

CONTAINS_STRING

This matcher selects customers with an attribute or key containing any of a list of strings. This matcher is case sensitive. Note that the strings should not be regex patterns, they are string literals that are used for exact contains matching.

Fields

strings: Mandatory.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

MATCHES_STRING

This matcher selects customers with an attribute or key that matches the regex pattern in string.

Fields

string: Mandatory.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

IN_SPLIT

This matcher is useful when you want to consider the experience of a customer for one Split in deciding the experience for the same customer for another Split. As an example, consider a team working on a brand new homepage and another team responsible for a new widget design on that new homepage. The Split controlling the widget should take into account whether or not the new homepage is turned on for a user.

Fields

depends: Mandatory. This object contains two fields, splitName and treatment.
attribute: Optional. If it is set the match will be triggered against the attribute. If it is not set, the match will be against the key provided.
negate: Optional.

Suggest Edits

Default Rule

 

The Default Rule is simply a list of buckets.
If a specific id did not match any Rule, then this rule is applied in order to determine the treatment to be returned.

Note that you do not need to provide all treatments in the Default Rule, however, the sum of treatment sizes must be 100

{
  "rules" : [{ "..." }],
  "defaultRule": [ 
    { "treatment": "on", size: 90 },
    { "treatment": "off", size: 10 } 
  ]
}

If no rule is matched for the id, then the Default Rule is evaluated and there is a 90% chance that the result will be on, and 10% chance that it will be off.

Suggest Edits

Create Split

Create a Split in your organization given a traffic type. This API does not configure the Split in any environment.

 
posthttps://api.split.io/internal/api/v1/splits/trafficTypes/traffic_type_id_or_name
curl -v -X POST -d '{"name":"paywall_beta","description":"description"}' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/trafficTypes/user
A binary file was returned

You couldn't be authenticated

{
    "name": "paywall_beta",
    "description": "description",
    "trafficType": {
        "type": "TRAFFIC_TYPE",
        "id": "8814ada0-8f4d-11e7-b345-124259445f48",
        "name": "user"
    },
    "creationTime": 1504300758457
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error creating splitmetadata with traffic type user",
    "transactionId": "9ohnm6fexz"
}
{
    "code": 404,
    "message": "Could not find traffic type user",
    "transactionId": "9ohocva33h"
}
{
    "code": 409,
    "message": "SplitMetadata already exists paywall_beta",
    "transactionId": "9ohptmhsi8"
}

Path Params

traffic_type_id_or_name
string
required

The id or case sensitive name of the traffic type used to create the split

Form Data

split
json

JSON object that contains the name and description of the Split.

 

JSON Payload Posted

{
 "name": String, // Mandatory
 "description": String // Optional
}
Suggest Edits

Get Split

Retrieves the Split.

 
gethttps://api.split.io/internal/api/v1/splits/split_name
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta
A binary file was returned

You couldn't be authenticated

{
    "name": "paywall_beta",
    "description": "A sample feature to help you learn how split works.",
    "trafficType": {
        "type": "TRAFFIC_TYPE",
        "id": "6414cea0-8f4d-11e7-b345-124259445f48",
        "name": "user"
    },
    "creationTime": 1504294821336
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error getting splitmetadata paywall_beta",
    "transactionId": "9oh3698lve"
}
{
    "code": 404,
    "message": "Could not find splitmetadata paywall_beta",
    "transactionId": "9oh3lpt0d0"
}

Path Params

split_name
string
required

The case sensitive name of the Split that will be retrieved

 

JSON Received

{
    "name": String,
    "description": String, 
    "trafficType": URN, // Containing id and name of the Traffic Type
    "creationTime": Number // Milliseconds since epoch
}
Suggest Edits

Delete Split

Delete a Split from your organization. This will automatically unconfigure the Split Definition from all environments. An SDK calling this Split will return "control".

 
deletehttps://api.split.io/internal/api/v1/splits/split_name
curl -v -X DELETE \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta
A binary file was returned

You couldn't be authenticated

true
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error deleting splitmetadata paywall_beta",
    "transactionId": "9oh5ar3mhy"
}
{
    "code": 404,
    "message": "Could not find splitmetadata paywall_beta",
    "transactionId": "9oh5po4izh"
}

Path Params

split_name
string
required

The case sensitive name of the Split that will be deleted you want to kill

 
Suggest Edits

List Splits

Retrieves the Splits for an organization.

 
gethttps://api.split.io/internal/api/v1/splits/
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits
A binary file was returned

You couldn't be authenticated

{
    "objects": [
        {
            "name": "sample_feature",
            "description": "A sample feature to help you learn how split works.",
            "trafficType": {
                "type": "TRAFFIC_TYPE",
                "id": "6414eaa0-8f4d-11e7-b345-124259445f48",
                "name": "user"
            },
            "creationTime": 1504294821336
        }
    ],
  ...
    "offset": 0,
    "limit": 20,
    "totalCount": N
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error listing splitmetadatas",
    "transactionId": "9ohbr8wmzf"
}

Query Params

offset
int32

The offset to retrieve. Useful for pagination

limit
string

The maximum split metadatas to return per call. Max=50.

 

JSON Received

{
    "objects": [ SPLIT ], // Array of Splits returned
    "offset": Number, // Offset received
    "limit": Number, // Limit received
    "totalCount": Number // Total number of Splits
}
Suggest Edits

Create Split Definition in Environment

Configures a Split Definition for a specific environment.

 
posthttps://api.split.io/internal/api/v1/splits/split_name/environments/environment_id_or_name
curl -v -X POST \
  -d '{"treatments":[{"name":"on"},{"name":"off"}],"defaultTreatment":"off","rules":[{"buckets":[{"treatment":"on","size":50},{"treatment":"off","size":50}],"condition":{"matchers":[{"type":"IN_SEGMENT","string":"employees"}]}}],"defaultRule":[{"treatment":"off","size":100}]}' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production
A binary file was returned

You couldn't be authenticated

{
      "name":"paywall_beta",
      "environment": { "type":"Environment", "id": "dde603a0-30f1-11e7-ba78-12395d4a9634","name":"Production" },
      "trafficType": { "type":"TRAFFIC_TYPE", "id": "4d3405a0-9ca5-11e5-9706-16a11fb02dec","name":"user" },
      "killed":false,
      "treatments":[{"name":"on"},{"name":"off"}],
      "defaultTreatment":"off",
      "trafficAllocation":100,
      "rules": [
            {
                  "buckets":[{"treatment":"on","size":50},{"treatment":"off","size":50}],
                  "condition": {
                      "combiner": "AND",
                      "matchers": [
                          {"type":"IN_SEGMENT","string":"employees"}
                      ]
                  }
            } 
      ],
      "defaultRule": [ {"treatment":"off","size":100} ],
      "creationTime":1508522181447,
      "lastUpdateTime":1508522181447
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error creating splitmetadata with traffic type user",
    "transactionId": "9ohnm6fexz"
}
{
    "code": 404,
    "message": "Could not find traffic type user",
    "transactionId": "9ohocva33h"
}
{
    "code": 409,
    "message": "SplitMetadata already exists paywall_beta",
    "transactionId": "9ohptmhsi8"
}
{
    "code": 404,
    "message": "Could not find splitmetadata paywall_beta",
    "transactionId": "9ty4h6w63k"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want to create the split

split_name
string
required

The case sensitive name of the Split that will be configured

Form Data

split
json

JSON object that contains the split

 

JSON Payload

{
  "treatments": [ Treatment ], // Mandatory
  "defaultTreatment": String, // Mandatory
  "rules": [ Rule ], // Optional
  "defaultRule": [ Bucket ] // Mandatory
}

Detailed information of the payload structure can be found on Split Grammar.

Suggest Edits

Get Split Definition in Environment

Retrieves a Split Definition given the name and the environment.

 
gethttps://api.split.io/internal/api/v1/splits/split_name/environments/environment_id_or_name
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production
A binary file was returned

You couldn't be authenticated

{
    "name": "paywall_beta",
    "environment": {
        "type": "Environment",
        "id": "2626cf50-73d7-11e7-91fb-0ec612a5b38a",
        "name": "Production"
    },
		"trafficType": { 
      	"type":"TRAFFIC_TYPE", 
      	"id": "4d3405a0-9ca5-11e5-9706-16a11fb02dec",
      	"name":"user"
    },
    "killed": false,
    "treatments": [ { "name": "on" }, { "name" : "off" } ],
    "defaultTreatment": "off",
    "trafficAllocation": 100,
    "rules": [
        {
            "buckets": [ 
                { "treatment" : "on", "size": 50 }, { "treatment": "off", "size": 50 } 
            ],
            "condition": {
                "combiner":"AND",
                "matchers": [ { "type": "IN_SEGMENT", "string": "employees" } ]
            }
        } 
    ],
    "defaultRule": [ { "treatment": "off", "size": 100 } ],
    "creationTime": 1508790002232,
    "lastUpdateTime": 1508790002232
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error getting split paywall_beta for environment Production",
    "transactionId": "9odlgm8gcl"
}
{
    "code": 404,
    "message": "Could not find ...",
    "transactionId": "9oel68tyhp"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want get the split

split_name
string
required

The case sensitive name of the Split that will be retrieved

 

JSON Received

{
    "name": String,
    "environment": URN, // Containing id and name of the environment
    "killed": Boolean,
    "treatments": [ Treatment ],
    "defaultTreatment": String,
    "trafficAllocation": Number, // Between 0 and 100
    "rules": [ Rule ],
    "creationTime": Number, // Milliseconds since epoch
    "lastUpdateTime": Number // Milliseconds since epoch
}

Detailed information of the payload structure can be found on Split Grammar.

Suggest Edits

Update Split Definition in Environment

Updates a Split Definition for a specific environment.

 
patchhttps://api.split.io/internal/api/v1/splits/split_name/environments/environment_id_or_name
curl -v -X PATCH \
  -d '[{"op": "replace", "path": "/trafficAllocation", "value":50}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production
A binary file was returned

You couldn't be authenticated

{
    "name": "paywall_beta",
    "trafficAllocation": 50,
    ...
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error deleting split test for environment Production",
    "transactionId": "9of55hrmyp"
}
{
    "code": 404,
    "message": "Could not find split paywall_beta for environment Production",
    "transactionId": "9oezqemsif"
}
{
    "code": 400,
    "message": "Failed to update paywall_beta on environment Production",
    "transactionId": "9ty4h6w63k"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want get the split

split_name
string
required

The case sensitive name of the Split that will be updated

Form Data

update_split
json

JSON object that contains the attributes of a split to be updated in JsonPatch format

 

This API call allows to update any field of a split using JsonPatch.

A few examples below.

Kill / Restore a Split

curl -v -X PATCH \
  -d '[{"op": "replace", "path": "/killed", "value": true}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will kill a Split for a particular environment.

Change Traffic Allocation

curl -v -X PATCH \
  -d '[{"op": "replace", "path": "/trafficAllocation", "value":50}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will change the traffic allocation to 50.

Change Default Treatment

curl -v -X PATCH \
  -d '[{"op": "replace", "path": "/defaultTreatment", "value": "on"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will set the default treatment to "on".

Add a Key (i.e user) to an includes of a treatment.

Given a treatment that already has one or more keys

curl -v -X PATCH \
  -d '[{"op": "add", "path": "/treatments/0/keys/-", "value": "4"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will add the key "4" to the include keys of the first treatment.

Remove a Key (i.e user) from an includes of a treatment

curl -v -X PATCH \
  -d '[{"op": "remove", "path": "/treatments/0/keys/2"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will remove the third element of the include keys of the first treatment.

Replace a Key (i.e user) from an includes of a treatment

curl -v -X PATCH \
  -d '[{"op": "replace", "path": "/treatments/0/keys/0", "value": "7"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above replaces the first element of the include keys of the first treatment and sets it to "7"

Add a Segment (i.e employees) to an includes of a treatment

Given a treatment that already has a segment on the includes.

curl -v -X PATCH \
  -d '[{"op": "add", "path": "/treatments/1/segments/-", "value": "beta"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will add the segment "beta" to the second treatment.

Remove a Segment (i.e employees) from an includes of a treatment

curl -v -X PATCH \
  -d '[{"op": "remove", "path": "/treatments/0/segments/1"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will remove the second segment from the includes of the first treatment.

Rename a Treatment

Given the Split Definition

{
 "...",
 "treatments" :[{ "name":"on" }, {"name":"off" } ],
 "rules" :[
  {
   "...",
   "buckets": [
    { "treatment":"on","size":80 },
    { "treatment":"off","size":20 }
   ]
  }
 ],
 "defaultRule": [
   { "treatment":"on", "size": 50 },
   { "treatment":"off", "size": 50}
 ],
 "..."
}

To rename "on" to "first_version":

curl -v -X PATCH \
  -d '[{ "op": "replace", "path": "/rules/0/buckets/0/treatment", "value": "first_version" }, { "op": "replace", "path": "/treatments/0/name", "value": "first_version" }, { "op": "replace", "path": "/defaultRule/0/treatment", "value": "first_version" }]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

Add a Rule

Given the Split Definition

{
 "...",
 "treatments" :[{ "name":"on" }, {"name":"off" } ],
 "rules" :[{"..."}],
 "defaultRule": [
   { "treatment":"on", "size": 50 },
   { "treatment":"off", "size": 50}
 ],
 "..."
}

To add a Rule:

curl -v -X PATCH \
  -d '[{"op": "add", "path": "/rules/0", "value": {"buckets":[{"treatment":"on","size":50},{"treatment":"off","size":50}],"condition":{"matchers":[{"type":"IN_SEGMENT","string":"employees"}]}}}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will add the "In Segment" rule as the first rule of the split

Remove a Rule

curl -v -X PATCH \
  -d '[{"op": "remove", "path": "/rules/1"}]' \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production

The example above will remove the second rule of the Split

Suggest Edits

Remove Split Definition from Environment

Unconfigures a Split Definition for a specific environment. Any SDK calling this split will return "control" for the selected environment.

 
deletehttps://api.split.io/internal/api/v1/splits/split_name/environments/environment_id_or_name
curl -v -X DELETE \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production
A binary file was returned

You couldn't be authenticated

true
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error deleting split paywall_beta for environment Production",
    "transactionId": "9of55hrmyp"
}
{
    "code": 404,
    "message": "Could not find split paywall_beta for environment Production",
    "details": null,
    "transactionId": "9oezqemsif"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want get the split

split_name
string
required

The case sensitive name of the Split that will be unconfigured

 
Suggest Edits

Lists Split Definitions in Environment

Retrieves the Split Definitions given an environment.

 
gethttps://api.split.io/internal/api/v1/splits/environments/environment_id_or_name
curl -v -X GET \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/environments/Production
A binary file was returned

You couldn't be authenticated

{
    "objects": [
        {
            "name": "paywall_beta",
            "environment": { ... },
          	"trafficType": { ... },
            "killed": false,
            "treatments": [ { ... } ],
            "defaultTreatment": "off",
            "trafficAllocation": 100,
            "rules": [ { ... } ],
            "creationTime": 1508261321997,
            "lastUpdateTime": 1508261321997        
        },
        { ... }
    ],
    "offset": 0,
    "limit": 20,
    "totalCount": N
}
{
    "code": 403,
    "message": "Organization does not have permissions to execute API",
    "transactionId": "9oek34hvot"
}
{
    "code": 401,
    "message": "Error listing splits for environment Production",
    "transactionId": "9ofcp0yvpb"
}
{
    "code": 404,
    "message": "Could not find environment Production",
    "transactionId": "9ofdd0bn9m"
}

Path Params

environment_id_or_name
string
required

The id or case sensitive name of the environment in which you want get the split

Query Params

offset
int32

The offset to retrieve. Useful for pagination

limit
string

The maximum splits to return per call. Max=50.

 

JSON Received

{
    "objects": [ SPLIT_DEFINITIONS ], // Array of Split Definitions returned
    "offset": Number, // Offset received
    "limit": Number, // Limit received
    "totalCount": Number // Total number of Split Definitions
}
Suggest Edits

Kill Split in Environment

Kill a feature in a specific environment

 
puthttps://api.split.io/internal/api/v1/split_name/environments/environment_name_or_id/kill
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production/kill
A binary file was returned

You couldn't be authenticated

// no object returned
// no object returned
{
  "code": 403,
  "message": "Failed to kill $split_name in $environment_id_or_name"
}
{
  "code": 500,
  "message": "Failed to kill $split_name in $environment_id_or_name"
}
{
  "code":400,
  "message":"Failed to kill name=$split_name, environment=$environment_id"
}

Path Params

environment_name_or_id
string
required

The id or case sensitive name of the environment in which you want to kill the feature

split_name
string
required

The case sensitive name of the split you want to kill

 
Suggest Edits

Restore Split in Environment

Restore a feature in a specific environment

 
puthttps://api.split.io/internal/api/v1/splits/split_name/environments/environment_name_or_id/restore
curl -v -X PUT \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer ADMIN_API_KEY' \
  https://api.split.io/internal/api/v1/splits/paywall_beta/environments/Production/restore
A binary file was returned

You couldn't be authenticated

// no object returned
// no object returned
{
  "code": 403,
  "message": "Failed to kill $split_name in $environment_id_or_name"
}
{
  "code": 500,
  "message": "Failed to kill $split_name in $environment_id_or_name"
}
{
  "code":400,
  "message":"Failed to kill name=$split_name, environment=$environment_id"
}

Path Params

environment_name_or_id
string
required

The id or case sensitive name of the environment in which you want to restore the feature

split_name
string
required

The case sensitive name of the split you want to restore