Flags Endpoint
Get all flags
Section titled “Get all flags”Fetches the complete flag configuration for the authenticated environment. SDKs typically call this once during initialization and then keep the data in memory.
GET /flagsResponse
Section titled “Response”{ "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" } ]}Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
environment | string | Environment identifier for the SDK key |
version | int | Configuration version (increments on any change) |
flags | FlagDto[] | All flags in this environment |
segments | SegmentDto[] | All segments (referenced by targeting rules) |
Get a single flag
Section titled “Get a single flag”Fetches the configuration for one flag by its key.
GET /flags/{key}Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
key | string | The flag key |
Response
Section titled “Response”Returns a single FlagDto object (see data types below). Returns 404 if the flag does not exist.
Data types
Section titled “Data types”FlagDto
Section titled “FlagDto”| Field | Type | Description |
|---|---|---|
key | string | Unique flag identifier |
version | int | Flag configuration version |
type | string | "Boolean", "String", "Number", or "Json" |
enabled | bool | Whether the flag is on in this environment |
variations | VariationDto[] | All possible return values |
rules | RuleDto[] | Targeting rules, evaluated in priority order |
fallthrough | ServeConfigDto | What to serve when the flag is on and no rules match |
offVariation | string | Variation key returned when the flag is off |
VariationDto
Section titled “VariationDto”| Field | Type | Description |
|---|---|---|
key | string | Variation identifier |
value | any | The value (boolean, string, number, or JSON object) |
RuleDto
Section titled “RuleDto”| Field | Type | Description |
|---|---|---|
id | string | Rule identifier |
priority | int | Execution order (lower = evaluated first) |
conditions | ConditionDto[] | Conditions to evaluate |
conditionLogic | string | "And" (all must match) or "Or" (any must match) |
serve | ServeConfigDto | What to serve if the rule matches |
segmentKey | string? | Segment key if the rule targets a segment |
ConditionDto
Section titled “ConditionDto”| Field | Type | Description |
|---|---|---|
attribute | string | Context attribute to check (e.g., "userId", "country") |
operator | string | Comparison operator (see below) |
values | string[] | Values to compare against |
negate | bool | Invert the condition result |
Condition operators: Equals, NotEquals, Contains, NotContains, StartsWith, EndsWith, In, NotIn, MatchesRegex, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, Before, After
ServeConfigDto
Section titled “ServeConfigDto”| Field | Type | Description |
|---|---|---|
type | string | "Fixed" or "Rollout" |
variation | string? | Variation key (when type is Fixed) |
bucketBy | string? | Attribute to hash for rollout bucketing |
salt | string? | Hash salt for consistent bucketing |
variations | WeightedVariationDto[]? | Weighted variations (when type is Rollout) |
WeightedVariationDto
Section titled “WeightedVariationDto”| Field | Type | Description |
|---|---|---|
key | string | Variation identifier |
weight | int | Percentage weight (0—100, must sum to 100 across all entries) |
SegmentDto
Section titled “SegmentDto”| Field | Type | Description |
|---|---|---|
key | string | Segment identifier |
version | int | Configuration version |
conditions | ConditionDto[] | Conditions that define segment membership |
conditionLogic | string | "And" or "Or" |
See also
Section titled “See also”- API Overview — authentication, rate limiting, and all endpoints
- Evaluate Endpoint — evaluate flags for user contexts
- Streaming Endpoint — receive real-time
flag.updatedevents - Targeting & Segments — understand rules, conditions, and segments
- SDK Overview — official SDKs fetch and cache flags automatically