Create Segment
Reference for the POST /console/v1/segments endpoint of the Statsig API.
https://statsigapi.net/console/v1/segmentsAuthorizations
STATSIG-API-KEYstringrequiredapiKey (header)
Body
application/jsonnamestringrequiredname of the segment
min length: 3max length: 100pattern: ^[a-zA-Z0-9_\- ]*$idstringoptional id of the segment (defaults to name)
min length: 3max length: 100pattern: ^[a-zA-Z0-9_-]*$descriptionstringdescription of the segment
max length: 1000typestringrequiredtype of the segment
id_listrule_basedanalysis_listuser_store_id_listidTypestringtype of id
userIDtagsstring[]optional tags for categorization
creatorIDstringthe Statsig ID of the creator of this experiment
nullablecreatorEmailstringthe email of the creator of this experiment
nullableteamstringoptional name identifier for the responsible team (enterprise only)
nullableteamIDstringoptional identifier for the responsible team (enterprise only)
nullablerulesobject[]Rule Object
Show child attributes
namestringrequiredThe name of this rule.
passPercentagenumberrequiredOf the users that meet the conditions of this rule, what percent should return true.
min: 0max: 100conditionsobject[]requiredtargetValueoneOfnullablestring[]number[]stringnumberoperatorstringfieldstringnullablecustomIDstringnullabletypestringrequiredapp_versionbrowser_namebrowser_versioncountrycustom_fieldemailenvironment_tierfails_segmentip_addressos_nameos_versionpasses_segmentunit_iduser_idenvironmentsstring[]The environments this rule is enabled for.
nullableidstringThe Statsig ID of this rule.
baseIDstringThe base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
returnValueobjectThe return value of the rule.
completedAutomatedRolloutsobject[]Read-only: Automated rollout phases that have already completed.
timenumberpassPercentnumberrequiredpendingAutomatedRolloutsobject[]Read-only: Automated rollout phases that are scheduled but not yet complete.
timenumberpassPercentnumberrequiredResponse
application/jsonmessagestringrequiredA simple string explaining the result of the operation.
dataobjectrequiredShow child attributes
isEnabledbooleanrequiredIs the segment enabled.
typestringrequiredid_listrule_basedanalysis_listuser_store_id_listcountnumberFor id_list segments: the length of the ID list
format: doublerulesobject[]Rule Object
namestringrequiredThe name of this rule.
passPercentagenumberrequiredOf the users that meet the conditions of this rule, what percent should return true.
min: 0max: 100conditionsobject[]requiredAn array of Condition objects.
targetValueoneOfnullablestring[]number[]stringnumberoperatorstringfieldstringnullablecustomIDstringnullabletypestringrequiredapp_versionbrowser_namebrowser_versioncountrycustom_fieldemailenvironment_tierfails_gatefails_segmentip_addresslocaleos_nameos_versionpasses_gatepasses_segmentpublictimeunit_iduser_iduser_agenturljavascriptdevice_modeltarget_appexperiment_groupenvironmentsstring[]The environments this rule is enabled for.
nullableidstringThe Statsig ID of this rule.
baseIDstringThe base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
returnValueobjectThe return value of the rule.
tagsstring[]Optional tags for categorization.
idstringrequiredID
namestringOptional name for the configuration.
idTypestringrequiredType of ID
descriptionstringrequiredDetailed description of the configuration’s purpose.
lastModifierIDstringrequiredID of the last modifier.
nullablelastModifiedTimenumberrequiredTime of the last modification.
format: doublenullablelastModifierEmailstringrequiredEmail of the last modifier.
nullablelastModifierNamestringrequiredName of the last modifier.
nullablecreatorIDstringrequiredID of the user who created the entity.
nullablecreatedTimenumberrequiredTimestamp when the entity was created.
format: doublecreatorNamestringrequiredName of the creator.
nullablecreatorEmailstringrequiredEmail of the creator.
nullabletargetAppsstring[]List of target applications associated with this configuration.
holdoutIDsstring[]Holdouts applied to this configuration.
teamstringOptional name for the responsible team.
nullableteamIDstringOptional ID of the responsible team.
nullableversionnumberVersion number
format: doublestatusintegerrequired401messagestringrequiredWas this helpful?