curl --request POST \
--url https://statsigapi.net/console/v1/segments \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"type": "id_list",
"id": "<string>",
"description": "<string>",
"idType": "userID",
"tags": [
"<string>"
],
"creatorID": "<string>",
"creatorEmail": "<string>",
"team": "<string>",
"teamID": "<string>",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"type": "app_version",
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {}
}
]
}
'{
"message": "Segment created successfully.",
"data": {
"id": "an_id_list",
"isEnabled": true,
"description": "helpful summary of what this segment is",
"lastModifierName": "CONSOLE API",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"type": "id_list",
"count": 0,
"tags": [
"a tag"
]
}
}curl --request POST \
--url https://statsigapi.net/console/v1/segments \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"type": "id_list",
"id": "<string>",
"description": "<string>",
"idType": "userID",
"tags": [
"<string>"
],
"creatorID": "<string>",
"creatorEmail": "<string>",
"team": "<string>",
"teamID": "<string>",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"type": "app_version",
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {}
}
]
}
'{
"message": "Segment created successfully.",
"data": {
"id": "an_id_list",
"isEnabled": true,
"description": "helpful summary of what this segment is",
"lastModifierName": "CONSOLE API",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"type": "id_list",
"count": 0,
"tags": [
"a tag"
]
}
}Optional header to respect review settings for mutation endpoints.
name of the segment
3 - 100type of the segment
id_list, rule_based, analysis_list optional id of the segment (defaults to name)
3 - 100description of the segment
1000type of id
optional tags for categorization
the Statsig ID of the creator of this experiment
the email of the creator of this experiment
optional name identifier for the responsible team (enterprise only)
optional identifier for the responsible team (enterprise only)
Rule Object
Show child attributes
The name of this rule.
Of the users that meet the conditions of this rule, what percent should return true.
0 <= x <= 100Must be a multiple of 0.01Show child attributes
app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_segment, ip_address, os_name, os_version, passes_segment, unit_id, user_id The environments this rule is enabled for.
The Statsig ID of this rule.
The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
Create Segment Success
A simple string explaining the result of the operation.
A single result.
Show child attributes
Is the segment enabled.
id_list, rule_based, analysis_list ID
Type of ID
Detailed description of the configuration’s purpose.
ID of the last modifier.
Time of the last modification.
Email of the last modifier.
Name of the last modifier.
ID of the user who created the entity.
Timestamp when the entity was created.
Name of the creator.
Email of the creator.
For id_list segments: the length of the ID list
Rule Object
Show child attributes
The name of this rule.
Of the users that meet the conditions of this rule, what percent should return true.
0 <= x <= 100Must be a multiple of 0.01An array of Condition objects.
Show child attributes
app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, url, javascript, device_model, target_app The environments this rule is enabled for.
The Statsig ID of this rule.
The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
Optional tags for categorization.
Optional name for the configuration.
List of target applications associated with this configuration.
Holdouts applied to this configuration.
Optional name for the responsible team.
Optional ID of the responsible team.
Version number