Features API
Retrieve feature flag states and configuration from the Flagstack API.
List All Features
Get all features and their current state for the token's environment.
GET /api/v1/features
Example Request
$ curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://flagstack.io/api/v1/features
Example Response
{
"features": [
{
"key": "new_checkout",
"state": "on",
"gates": [
{ "key": "boolean", "value": true }
]
},
{
"key": "beta_feature",
"state": "conditional",
"gates": [
{ "key": "boolean", "value": false },
{ "key": "actors", "value": ["User;123", "User;456"] },
{ "key": "percentage_of_actors", "value": 25 }
]
}
]
}
Get Single Feature
Retrieve a specific feature by its key.
GET /api/v1/features/:key
Example Request
$ curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://flagstack.io/api/v1/features/new_checkout
Example Response
{
"key": "new_checkout",
"state": "on",
"gates": [
{ "key": "boolean", "value": true }
]
}
Gate Types
The response includes all gates configured for each feature:
| Gate Key | Value Type | Description |
|---|---|---|
boolean |
boolean | Master on/off switch |
actors |
array of strings | Enabled actor IDs |
groups |
array of strings | Enabled group names |
percentage_of_actors |
integer (0-100) | Percentage rollout |
percentage_of_time |
integer (0-100) | Random percentage |