curl --request GET \
--url https://statsigapi.net/console/v1/segments \
--header 'STATSIG-API-KEY: <api-key>'
{
"message": "Segments listed 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"
]
},
{
"id": "a_rule_based_segment",
"isEnabled": true,
"description": "helpful summary of what this segment is",
"lastModifierName": "CONSOLE API",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"type": "rule_based",
"count": 0,
"rules": {
"name": "All Conditions",
"passPercentage": 10,
"conditions": [
{
"type": "public",
"operator": "string",
"targetValue": 0,
"field": "string",
"customID": "string"
}
],
"returnValue": {
"key": true
}
},
"tags": [
"a tag"
]
}
]
}
Optional header to respect review settings for mutation endpoints.
List Segments Success
The response is of type object
.
curl --request GET \
--url https://statsigapi.net/console/v1/segments \
--header 'STATSIG-API-KEY: <api-key>'
{
"message": "Segments listed 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"
]
},
{
"id": "a_rule_based_segment",
"isEnabled": true,
"description": "helpful summary of what this segment is",
"lastModifierName": "CONSOLE API",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"type": "rule_based",
"count": 0,
"rules": {
"name": "All Conditions",
"passPercentage": 10,
"conditions": [
{
"type": "public",
"operator": "string",
"targetValue": 0,
"field": "string",
"customID": "string"
}
],
"returnValue": {
"key": true
}
},
"tags": [
"a tag"
]
}
]
}