Skip to content

API Endpoints

Base URL: https://edgeflags.net

All endpoints under /api/v1/ require a Bearer token. See Authentication.

Public endpoints

These endpoints do not require authentication.

MethodPathDescription
GET/healthHealth check
GET/docsSwagger UI
GET/openapi.jsonOpenAPI 3.0 schema

GET /health

Terminal window
curl https://edgeflags.net/health
{ "status": "ok", "environment": "production" }

Flag endpoints

MethodPathPermissionDescription
GET/api/v1/flagsread:flagsList flags
GET/api/v1/flags/:keyread:flagsEvaluate a flag
POST/api/v1/flagswrite:flagsCreate a flag
PUT/api/v1/flags/:keywrite:flagsUpdate a flag
DELETE/api/v1/flags/:keywrite:flagsDelete a flag
PUT/api/v1/flags/:key/environments/:envwrite:flagsSet environment override
DELETE/api/v1/flags/:key/environments/:envwrite:flagsRemove environment override

GET /api/v1/flags

List all flags with pagination.

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/flags?limit=50&offset=0"
{
"flags": [
{ "key": "dark_mode", "flag": { "enabled": true, "value": true, "version": 1 } }
],
"total": 1,
"has_more": false
}

GET /api/v1/flags/:key

Evaluate a flag, optionally with user context.

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/flags/dark_mode?context=%7B%22user_id%22%3A%22u_123%22%7D"
{
"value": true,
"type": "boolean",
"reason": "override"
}

The reason field indicates why this value was returned: disabled, override, targeting, rollout, default, or environment_override.

POST /api/v1/flags

Create a new flag.

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "new_checkout",
"enabled": true,
"value": false,
"targeting": {
"rules": [
{
"conditions": [
{ "property": "plan", "operator": "equals", "value": "premium" }
],
"value": true
}
],
"rollout": { "percentage": 25, "attribute": "user_id" }
},
"environments": {
"production": { "enabled": false }
},
"active_from": "2026-01-01T00:00:00Z",
"active_until": "2026-12-31T23:59:59Z"
}' \
"https://edgeflags.net/api/v1/flags"
{ "success": true, "key": "new_checkout", "flag": { "enabled": true, "value": false, "version": 1, "..." : "..." } }

Returns 409 Conflict if the key already exists.

PUT /api/v1/flags/:key

Update an existing flag. Only include the fields you want to change.

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "If-Match: \"1\"" \
-d '{ "enabled": false }' \
"https://edgeflags.net/api/v1/flags/new_checkout"
{ "success": true, "key": "new_checkout", "flag": { "enabled": false, "version": 2, "..." : "..." } }

Returns 404 Not Found if the flag doesn’t exist, 409 Conflict if the If-Match version doesn’t match.

DELETE /api/v1/flags/:key

Terminal window
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/flags/new_checkout"
{ "success": true, "key": "new_checkout" }

PUT /api/v1/flags/:key/environments/:env

Set an environment-specific override.

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "enabled": true, "value": true }' \
"https://edgeflags.net/api/v1/flags/new_checkout/environments/staging"
{ "success": true, "key": "new_checkout", "environment": "staging", "override": { "enabled": true, "value": true } }

DELETE /api/v1/flags/:key/environments/:env

Terminal window
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/flags/new_checkout/environments/staging"

Config endpoints

MethodPathPermissionDescription
GET/api/v1/configsread:configsList configs
GET/api/v1/configs/:keyread:configsGet a config value
POST/api/v1/configswrite:configsCreate a config
PUT/api/v1/configs/:keywrite:configsUpdate a config
DELETE/api/v1/configs/:keywrite:configsDelete a config
PUT/api/v1/configs/:key/environments/:envwrite:configsSet environment override
DELETE/api/v1/configs/:key/environments/:envwrite:configsRemove environment override

POST /api/v1/configs

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "api_limits",
"value": { "requests_per_minute": 1000, "burst_limit": 2000 },
"environments": {
"production": { "value": { "requests_per_minute": 5000, "burst_limit": 10000 } }
}
}' \
"https://edgeflags.net/api/v1/configs"
{ "success": true, "key": "api_limits", "config": { "value": { "requests_per_minute": 1000 }, "version": 1 } }

PUT /api/v1/configs/:key

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "If-Match: \"1\"" \
-d '{ "value": { "requests_per_minute": 2000 } }' \
"https://edgeflags.net/api/v1/configs/api_limits"

GET /api/v1/configs/:key

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/configs/api_limits"
{ "value": { "requests_per_minute": 1000, "burst_limit": 2000 } }

Segment endpoints

MethodPathPermissionDescription
GET/api/v1/segmentswrite:flagsList segments
GET/api/v1/segments/:keywrite:flagsGet a segment
POST/api/v1/segmentswrite:flagsCreate a segment
PUT/api/v1/segments/:keywrite:flagsUpdate a segment
DELETE/api/v1/segments/:keywrite:flagsDelete a segment

POST /api/v1/segments

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "beta_users",
"conditions": [
{ "property": "email", "operator": "contains", "value": "@beta.com" }
]
}' \
"https://edgeflags.net/api/v1/segments"
{ "success": true, "key": "beta_users", "segment": { "conditions": [...], "version": 1 } }

GET /api/v1/segments/:key

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/segments/beta_users"
{ "key": "beta_users", "segment": { "conditions": [...], "version": 1 } }

Evaluation endpoint

MethodPathPermissionDescription
POST/api/v1/evaluateread:flags and/or read:configsBulk evaluate

POST /api/v1/evaluate

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"context": {
"user_id": "u_123",
"plan": "premium",
"environment": "production",
"custom": { "country": "US" }
},
"flags": ["new_checkout", "dark_mode"],
"configs": ["payment_providers"]
}' \
"https://edgeflags.net/api/v1/evaluate"
{
"flags": { "new_checkout": true, "dark_mode": true },
"configs": { "payment_providers": { "stripe_public_key": "pk_live_xyz" } }
}

GET /api/v1/evaluate returns 405 Method Not Allowed.


Token endpoints

MethodPathPermissionDescription
GET/api/v1/tokens*List tokens
POST/api/v1/tokens*Create a token
DELETE/api/v1/tokens/:hash*Delete a token

POST /api/v1/tokens

Terminal window
curl -X POST \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD pipeline",
"project_id": "default",
"permissions": ["read:flags", "read:configs"],
"expires_at": "2027-01-01T00:00:00Z"
}' \
"https://edgeflags.net/api/v1/tokens"
{
"success": true,
"token": "ff_defa_k1a2b3c4d5e6f7g8h9i0",
"meta": {
"name": "CI/CD pipeline",
"token_prefix": "ff_defa_k1a2",
"project_id": "default",
"permissions": ["read:flags", "read:configs"],
"expires_at": "2027-01-01T00:00:00Z",
"created_at": "2026-01-15T10:00:00.000Z"
}
}

Webhook endpoints

MethodPathPermissionDescription
GET/api/v1/webhooks*List webhooks
POST/api/v1/webhooks*Create a webhook
DELETE/api/v1/webhooks/:id*Delete a webhook

POST /api/v1/webhooks

Terminal window
curl -X POST \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-service.com/webhooks",
"secret": "whsec_signing_secret",
"events": ["flag.created", "flag.updated", "flag.deleted"]
}' \
"https://edgeflags.net/api/v1/webhooks"
{
"success": true,
"id": "a1b2c3d4e5f6a7b8",
"config": { "url": "https://your-service.com/webhooks", "has_secret": true, "events": ["flag.created", "flag.updated", "flag.deleted"] }
}

Audit endpoint

MethodPathPermissionDescription
GET/api/v1/audit*Query audit log

GET /api/v1/audit

Terminal window
curl -H "Authorization: Bearer $ADMIN_TOKEN" \
"https://edgeflags.net/api/v1/audit?resource_type=flag&limit=20"
{
"entries": [
{
"timestamp": "2026-01-15T10:30:00.000Z",
"actor": "ff_defa_k1a2...",
"action": "update",
"resource_type": "flag",
"resource_key": "new_checkout",
"project_id": "default",
"before": { "..." : "..." },
"after": { "..." : "..." }
}
],
"total": 42,
"has_more": true
}

Project endpoints

MethodPathPermissionDescription
GET/api/v1/projectanyGet project info
PUT/api/v1/project*Update project
GET/api/v1/project/environmentsanyList environments
POST/api/v1/project/environments*Add environment
DELETE/api/v1/project/environments/:name*Remove environment

GET /api/v1/project

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/project"
{
"id": "default",
"name": "Default Project",
"slug": "default",
"environments": ["development", "staging", "production"]
}

POST /api/v1/project/environments

Terminal window
curl -X POST \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "canary" }' \
"https://edgeflags.net/api/v1/project/environments"
{ "success": true, "environments": ["development", "staging", "production", "canary"] }