Create Segment

posthttps://statsigapi.net/console/v1/segments

Authorizations

STATSIG-API-KEYstringrequired

apiKey (header)

Body

application/json
namestringrequired

name of the segment

idstring

optional id of the segment (defaults to name)

descriptionstring

description of the segment

typestringrequired

type of the segment

idTypestring

type of id

tagsstring[]

optional tags for categorization

creatorIDstring

the Statsig ID of the creator of this experiment

creatorEmailstring

the email of the creator of this experiment

teamstring

optional name identifier for the responsible team (enterprise only)

teamIDstring

optional identifier for the responsible team (enterprise only)

rulesobject[]

Rule Object

Show child attributes
name[]stringrequired

The name of this rule.

passPercentage[]numberrequired

Of the users that meet the conditions of this rule, what percent should return true.

conditions[]object[]required
targetValue[]oneOf
operator[]string
field[]string
customID[]string
type[]stringrequired
environments[]string[]

The environments this rule is enabled for.

id[]string

The Statsig ID of this rule.

baseID[]string

The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout

returnValue[]object

The return value of the rule.

completedAutomatedRollouts[]object[]

Read-only: Automated rollout phases that have already completed.

time[]number
passPercent[]numberrequired
pendingAutomatedRollouts[]object[]

Read-only: Automated rollout phases that are scheduled but not yet complete.

time[]number
passPercent[]numberrequired

Response

application/json
201· Create Segment Success
messagestringrequired

A simple string explaining the result of the operation.

dataobjectrequired
Show child attributes
isEnabledbooleanrequired

Is the segment enabled.

typestringrequired
countnumber

For id_list segments: the length of the ID list

rulesobject[]

Rule Object

name[]stringrequired

The name of this rule.

passPercentage[]numberrequired

Of the users that meet the conditions of this rule, what percent should return true.

conditions[]object[]required

An array of Condition objects.

targetValue[]oneOf
operator[]string
field[]string
customID[]string
type[]stringrequired
environments[]string[]

The environments this rule is enabled for.

id[]string

The Statsig ID of this rule.

baseID[]string

The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout

returnValue[]object

The return value of the rule.

tagsstring[]

Optional tags for categorization.

idstringrequired

ID

namestring

Optional name for the configuration.

idTypestringrequired

Type of ID

descriptionstringrequired

Detailed description of the configuration’s purpose.

lastModifierIDstringrequired

ID of the last modifier.

lastModifiedTimenumberrequired

Time of the last modification.

lastModifierEmailstringrequired

Email of the last modifier.

lastModifierNamestringrequired

Name of the last modifier.

creatorIDstringrequired

ID of the user who created the entity.

createdTimenumberrequired

Timestamp when the entity was created.

creatorNamestringrequired

Name of the creator.

creatorEmailstringrequired

Email of the creator.

targetAppsstring[]

List of target applications associated with this configuration.

holdoutIDsstring[]

Holdouts applied to this configuration.

teamstring

Optional name for the responsible team.

teamIDstring

Optional ID of the responsible team.

versionnumber

Version number

401· This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx
statusintegerrequired
messagestringrequired

Was this helpful?