curl --request POST \
--url https://statsigapi.net/console/v1/segments \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "<string>",
"id": "<string>",
"description": "<string>",
"type": "id_list",
"idType": "userID",
"tags": [
"<string>"
],
"creatorID": "<string>",
"creatorEmail": "<string>",
"team": "<string>",
"teamID": "<string>",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>",
"type": "app_version"
}
],
"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>",
"id": "<string>",
"description": "<string>",
"type": "id_list",
"idType": "userID",
"tags": [
"<string>"
],
"creatorID": "<string>",
"creatorEmail": "<string>",
"team": "<string>",
"teamID": "<string>",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>",
"type": "app_version"
}
],
"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.
Create Segment Success
The response is of type object
.