curl -X POST https://api.growthbook.io/api/v1/segment/seg_123abc \
-d '{"name":"User Region"}' \
-u secret_abc123DEF456:{
"segment": {
"id": "<string>",
"owner": "<unknown>",
"datasourceId": "<string>",
"identifierType": "<string>",
"name": "<string>",
"dateCreated": "<string>",
"dateUpdated": "<string>",
"description": "<string>",
"query": "<string>",
"managedBy": "",
"type": "SQL",
"factTableId": "<string>",
"filters": [
"<string>"
],
"projects": [
"<string>"
]
}
}Documentation Index
Fetch the complete documentation index at: https://growthbook-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
If using Bearer auth, pass the Secret Key as the token:
curl https://api.growthbook.io/api/v1 \
-H "Authorization: Bearer secret_abc123DEF456"The id of the requested resource
Name of the segment
Description of the segment
ID of the datasource this segment belongs to
Type of identifier (user, anonymous, etc.)
List of project IDs for projects that can access this segment
Where this Segment must be managed from. If not set (empty string), it can be managed from anywhere.
, api GrowthBook supports two types of Segments, SQL and FACT. SQL segments are defined by a SQL query, and FACT segments are defined by a fact table and filters.
SQL, FACT SQL query that defines the Segment. This is required for SQL segments.
ID of the fact table this segment belongs to. This is required for FACT segments.
Optional array of fact table filter ids that can further define the Fact Table based Segment.
Success
Show child attributes
curl -X POST https://api.growthbook.io/api/v1/segment/seg_123abc \
-d '{"name":"User Region"}' \
-u secret_abc123DEF456:{
"segment": {
"id": "<string>",
"owner": "<unknown>",
"datasourceId": "<string>",
"identifierType": "<string>",
"name": "<string>",
"dateCreated": "<string>",
"dateUpdated": "<string>",
"description": "<string>",
"query": "<string>",
"managedBy": "",
"type": "SQL",
"factTableId": "<string>",
"filters": [
"<string>"
],
"projects": [
"<string>"
]
}
}