API Reference
Base URL
Section titled “Base URL”https://api.flags.ggAuthentication
Section titled “Authentication”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. |
Endpoints
Section titled “Endpoints”GET /flags
Section titled “GET /flags”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. |
SDK Usage
Section titled “SDK Usage”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.
Rate Limiting
Section titled “Rate Limiting”The intervalAllowed field in the response tells clients how frequently they should poll for updates. SDKs respect this value automatically.
