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}
SegmentValuesDescription
typepk, skpk = publishable (client-side), sk = secret (server-side)
environmentdev, staging, prodThe environment this key is scoped to
keyIdrandom stringUnique key identifier
secretrandom stringCryptographic secret

Examples:

sk_prod_AbC12xYz_dGhpcyBpcyBhIHNlY3JldA     # secret key, production
pk_dev_XyZ98aBc_Y2xpZW50LXNpZGUta2V5         # publishable key, development

Core endpoints

MethodPathDescriptionKey type
GET/v1/flagsList all flags in the projectsk
POST/v1/flagsCreate a new flagsk
GET/v1/flags/:keyGet a specific flagsk
PATCH/v1/flags/:keyUpdate a flagsk
DELETE/v1/flags/:keyDelete a flagsk
POST/v1/evaluateEvaluate a flag for a user contextpk or sk
GET/v1/environmentsList environmentssk
POST/v1/environments/:id/api-keys/rotateRotate API keyssk

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

PlanRequests per minute
Free60
Pro600
EnterpriseCustom

Rate limit headers are included in every response:

X-RateLimit-Limit: 600
X-RateLimit-Remaining: 594
X-RateLimit-Reset: 1705312800