API Overview
The Flagify REST API lets you manage flags, environments, and targeting rules programmatically. All SDK operations are backed by this API.
Base URL
https://api.flagify.dev/v1
Authentication
All API requests require an API key passed via the X-API-Key header:
curl https://api.flagify.dev/v1/flags \
-H "X-API-Key: sk_prod_AbC12xYz_your-secret-key"
API key format
Flagify API keys follow a structured format:
{type}_{environment}_{keyId}_{secret}
| Segment | Values | Description |
|---|---|---|
type | pk, sk | pk = publishable (client-side), sk = secret (server-side) |
environment | dev, staging, prod | The environment this key is scoped to |
keyId | random string | Unique key identifier |
secret | random string | Cryptographic secret |
Examples:
sk_prod_AbC12xYz_dGhpcyBpcyBhIHNlY3JldA # secret key, production
pk_dev_XyZ98aBc_Y2xpZW50LXNpZGUta2V5 # publishable key, development
Core endpoints
| Method | Path | Description | Key type |
|---|---|---|---|
GET | /v1/flags | List all flags in the project | sk |
POST | /v1/flags | Create a new flag | sk |
GET | /v1/flags/:key | Get a specific flag | sk |
PATCH | /v1/flags/:key | Update a flag | sk |
DELETE | /v1/flags/:key | Delete a flag | sk |
POST | /v1/evaluate | Evaluate a flag for a user context | pk or sk |
GET | /v1/environments | List environments | sk |
POST | /v1/environments/:id/api-keys/rotate | Rotate API keys | sk |
Request format
All request bodies use JSON. Set the Content-Type header:
curl -X POST https://api.flagify.dev/v1/flags \
-H "X-API-Key: sk_prod_AbC12xYz_your-secret-key" \
-H "Content-Type: application/json" \
-d '{
"key": "new-feature",
"type": "boolean",
"description": "Enable the new feature"
}'
Response format
All responses return JSON with a consistent structure:
{
"data": {
"key": "new-feature",
"type": "boolean",
"enabled": false,
"created_at": "2025-01-15T10:30:00Z"
}
}
Errors follow the same structure:
{
"error": {
"code": "not_found",
"message": "Flag 'nonexistent' not found"
}
}
Rate limits
| Plan | Requests per minute |
|---|---|
| Free | 60 |
| Pro | 600 |
| Enterprise | Custom |
Rate limit headers are included in every response:
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 594
X-RateLimit-Reset: 1705312800