Skip to content

API Reference

https://api.flags.gg

All requests must include these headers:

Header Description
X-PROJECT-ID Your project identifier
X-AGENT-ID Your agent identifier
X-ENVIRONMENT-ID Your environment identifier

Optional headers for rollouts and targeting rules:

Header Description
X-Flags-Capabilities rollout if the client evaluates percentage rollouts itself. Without it, partially rolled-out flags are returned disabled.
X-Flags-Context Base64 (URL-safe or standard) JSON object describing the user. key is the targeting key; other attributes are strings or lists of strings, e.g. {"key":"user-1","plan":"pro","groups":["beta"]}. Used to evaluate rules. Max 8 KB.

Fetch all feature flags for the authenticated agent and environment.

Response:

{
"intervalAllowed": 900,
"flags": [
{
"enabled": true,
"details": {
"id": "flag-uuid",
"name": "my-feature"
},
"rollout": 25
}
]
}
Field Type Description
intervalAllowed integer Recommended refresh interval in seconds
flags array List of feature flags
flags[].enabled boolean Whether the flag is enabled
flags[].details.id string Unique flag identifier
flags[].details.name string Human-readable flag name
flags[].rollout integer Percentage (0–99) of users who see the flag. Omitted means 100%, or that a targeting rule already decided enabled. Only sent with X-Flags-Capabilities: rollout.

You typically don’t need to call the API directly — the SDKs handle all communication, caching, and error handling automatically. See the SDK overview for available client libraries.

The intervalAllowed field in the response tells clients how frequently they should poll for updates. SDKs respect this value automatically.