Segments
Create Segment
POST
apiKeyAuthheader
x-api-key<token>FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.
idOrSlug*stringapplication/json- body
key*stringname*stringdescription?string|null|nulltype*stringValue in
"dynamic""static"definition*members*array<>SegmentRecord
application/json- response
id*stringprojectId*stringkey*stringname*stringdescription*string|nulltype*stringValue in
"dynamic""static"definition*members*array<>flagCompatible*booleanusedBy*createdAt*stringupdatedAt*stringcurl -X POST 'https://api.faststats.dev/v0/projects/string/segments' \ -H 'Content-Type: application/json' \ -d '{ "key": "string", "name": "string", "type": "dynamic", "definition": { "type": "group", "match": "all", "negate": true, "children": [ {} ] }, "members": [ { "kind": "identifier", "value": "string", "excluded": true } ]}'Example Response
{ "id": "string", "projectId": "string", "key": "string", "name": "string", "description": "string", "type": "dynamic", "definition": { "type": "group", "match": "all", "negate": true, "children": [ {} ] }, "members": [ { "kind": "identifier", "value": "string", "excluded": true } ], "flagCompatible": true, "usedBy": { "segments": [ "string" ], "flags": [ "string" ] }, "createdAt": "string", "updatedAt": "string"}curl -X POST 'https://api.faststats.dev/v0/projects/string/segments' \
-H 'Content-Type: application/json' \
-d '{
"key": "string",
"name": "string",
"type": "dynamic",
"definition": {
"type": "group",
"match": "all",
"negate": true,
"children": [
{}
]
},
"members": [
{
"kind": "identifier",
"value": "string",
"excluded": true
}
]
}'{
"id": "string",
"projectId": "string",
"key": "string",
"name": "string",
"description": "string",
"type": "dynamic",
"definition": {
"type": "group",
"match": "all",
"negate": true,
"children": [
{}
]
},
"members": [
{
"kind": "identifier",
"value": "string",
"excluded": true
}
],
"flagCompatible": true,
"usedBy": {
"segments": [
"string"
],
"flags": [
"string"
]
},
"createdAt": "string",
"updatedAt": "string"
}