Skip to content

Flags Endpoint

Fetches the complete flag configuration for the authenticated environment. SDKs typically call this once during initialization and then keep the data in memory.

GET /flags
{
"environment": "env-abc123",
"version": 42,
"flags": [
{
"key": "dark-mode",
"version": 3,
"type": "Boolean",
"enabled": true,
"variations": [
{ "key": "on", "value": true },
{ "key": "off", "value": false }
],
"rules": [],
"fallthrough": {
"type": "Fixed",
"variation": "on"
},
"offVariation": "off"
}
],
"segments": [
{
"key": "beta-testers",
"version": 1,
"conditions": [
{
"attribute": "plan",
"operator": "In",
"values": ["pro", "enterprise"],
"negate": false
}
],
"conditionLogic": "And"
}
]
}
FieldTypeDescription
environmentstringEnvironment identifier for the SDK key
versionintConfiguration version (increments on any change)
flagsFlagDto[]All flags in this environment
segmentsSegmentDto[]All segments (referenced by targeting rules)

Fetches the configuration for one flag by its key.

GET /flags/{key}
ParameterTypeDescription
keystringThe flag key

Returns a single FlagDto object (see data types below). Returns 404 if the flag does not exist.


FieldTypeDescription
keystringUnique flag identifier
versionintFlag configuration version
typestring"Boolean", "String", "Number", or "Json"
enabledboolWhether the flag is on in this environment
variationsVariationDto[]All possible return values
rulesRuleDto[]Targeting rules, evaluated in priority order
fallthroughServeConfigDtoWhat to serve when the flag is on and no rules match
offVariationstringVariation key returned when the flag is off
FieldTypeDescription
keystringVariation identifier
valueanyThe value (boolean, string, number, or JSON object)
FieldTypeDescription
idstringRule identifier
priorityintExecution order (lower = evaluated first)
conditionsConditionDto[]Conditions to evaluate
conditionLogicstring"And" (all must match) or "Or" (any must match)
serveServeConfigDtoWhat to serve if the rule matches
segmentKeystring?Segment key if the rule targets a segment
FieldTypeDescription
attributestringContext attribute to check (e.g., "userId", "country")
operatorstringComparison operator (see below)
valuesstring[]Values to compare against
negateboolInvert the condition result

Condition operators: Equals, NotEquals, Contains, NotContains, StartsWith, EndsWith, In, NotIn, MatchesRegex, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, Before, After

FieldTypeDescription
typestring"Fixed" or "Rollout"
variationstring?Variation key (when type is Fixed)
bucketBystring?Attribute to hash for rollout bucketing
saltstring?Hash salt for consistent bucketing
variationsWeightedVariationDto[]?Weighted variations (when type is Rollout)
FieldTypeDescription
keystringVariation identifier
weightintPercentage weight (0—100, must sum to 100 across all entries)
FieldTypeDescription
keystringSegment identifier
versionintConfiguration version
conditionsConditionDto[]Conditions that define segment membership
conditionLogicstring"And" or "Or"