Direct API integration for custom implementations and serverless functions
Our REST API allows you to programmatically manage feature flags and their configurations. This documentation provides detailed information about available endpoints, authentication, and usage examples.
All API requests must include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
https://myflags.io/api
GET /flags
Retrieve all feature flags for a project
curl -X GET 'https://myflags.io/api/flags' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-api-env: development' \
-H 'x-api-project: YOUR_PROJECT_KEY'
{
"flag_name": false,
"flag_name_2": true
}
GET /api/flags/FLAG_ID
Check if a specific feature flag is enabled for a user
curl -X GET 'https://myflags.io/api/flags/FLAG_ID' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-api-env: development' \
-H 'x-api-project: YOUR_PROJECT_KEY'
{
"enabled": true
}
PATCH /api/flags/FLAG_ID
Update a feature flag's configuration
curl -X PATCH 'https://myflags.io/api/flags/FLAG_ID' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true
}'
{
"enabled": true
}
The API uses standard HTTP status codes to indicate success or failure:
API requests are limited to: