API Reference
v1.0.0Complete REST API for the Flagify platform. 57 endpoints across 15 sections.
https://api.flagify.dev/v1 Health
Health check
GET /health/check Public Health check
/health/check Public Response 200 — API is healthy
-
statusstringrequired -
envstringrequired
Example response
{
"status": "ok",
"env": "production"
} Auth
Authentication (register, login, refresh, logout)
POST /auth/register Public Register a new user
/auth/register Public Request body
-
emailstring (email)required -
passwordstringrequired -
namestringrequired -
deviceIdstringrequired
Response 201 — User registered
-
userobjectrequired-
idstring (uuid)required -
emailstring (email)required -
emailVerifiedAtstring | null -
namestring | null -
avatarUrlstring | null -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
tokensobjectrequired-
accessTokenstringrequired -
refreshTokenstringrequired
-
Example response
{
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
},
"tokens": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2g..."
}
} Errors
409 Resource already exists {
"code": "conflict",
"message": "resource already exists"
} 422 Validation failed {
"code": "unprocessable_entity",
"message": "validation failed"
} POST /auth/login Public Login
/auth/login Public Request body
-
emailstring (email)required -
passwordstringrequired -
deviceIdstringrequired
Response 200 — Login successful
-
userobjectrequired-
idstring (uuid)required -
emailstring (email)required -
emailVerifiedAtstring | null -
namestring | null -
avatarUrlstring | null -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
tokensobjectrequired-
accessTokenstringrequired -
refreshTokenstringrequired
-
Example response
{
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
},
"tokens": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2g..."
}
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} POST /auth/refresh Public Refresh access token
/auth/refresh Public Request body
-
refreshTokenstringrequired -
deviceIdstringrequired
Response 200 — Tokens refreshed
-
accessTokenstringrequired -
refreshTokenstringrequired
Example response
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2g..."
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} POST /auth/logout Bearer JWT Logout (revoke session)
/auth/logout Bearer JWT Request body
-
deviceIdstringrequired
Response 200 — Logged out
-
statusstringrequired
Example response
{
"status": "ok"
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} POST /auth/device/authorize Bearer JWT Authorize a device (CLI login flow)
/auth/device/authorize Bearer JWT Request body
-
deviceIdstringrequired
Response 200 — Device authorized
-
userobjectrequired-
idstring (uuid)required -
emailstring (email)required -
emailVerifiedAtstring | null -
namestring | null -
avatarUrlstring | null -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
tokensobjectrequired-
accessTokenstringrequired -
refreshTokenstringrequired
-
Example response
{
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
},
"tokens": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2g..."
}
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} Users
Current user profile
GET /users/me Bearer JWT Get current user profile
/users/me Bearer JWT Response 200 — User profile
-
idstring (uuid)required -
emailstring (email)required -
emailVerifiedAtstring | null -
namestring | null -
avatarUrlstring | null -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} PATCH /users/me Bearer JWT Update current user profile
/users/me Bearer JWT Request body
-
namestring -
avatarUrlstring
Response 200 — User updated
-
idstring (uuid)required -
emailstring (email)required -
emailVerifiedAtstring | null -
namestring | null -
avatarUrlstring | null -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} Workspaces
Workspace management
POST /workspaces Bearer JWT Create a workspace
/workspaces Bearer JWT Request body
-
namestringrequired -
slugstringrequired
Response 201 — Workspace created
-
idstring (uuid)required -
namestringrequired -
slugstringrequired -
planstringrequired -
seatLimitintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme-corp",
"plan": "pro",
"seatLimit": 10,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} Errors
409 Resource already exists {
"code": "conflict",
"message": "resource already exists"
} 422 Validation failed {
"code": "unprocessable_entity",
"message": "validation failed"
} GET /workspaces Bearer JWT List workspaces for current user
/workspaces Bearer JWT Response 200 — List of workspaces
-
idstring (uuid)required -
namestringrequired -
slugstringrequired -
planstringrequired -
seatLimitintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme-corp",
"plan": "pro",
"seatLimit": 10,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] GET /workspaces/slug/{slug}/check Bearer JWT Check workspace slug availability
/workspaces/slug/{slug}/check Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
slugrequired | string | path |
Response 200 — Slug availability result
-
slugstringrequired -
availablebooleanrequired -
suggestionstring
Example response
{
"slug": "acme-corp",
"available": true
} GET /workspaces/{wid} Bearer JWT Get workspace details
/workspaces/{wid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Response 200 — Workspace details
-
idstring (uuid)required -
namestringrequired -
slugstringrequired -
planstringrequired -
seatLimitintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme-corp",
"plan": "pro",
"seatLimit": 10,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} PATCH /workspaces/{wid} Bearer JWT Update workspace
/workspaces/{wid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Request body
-
namestring
Response 200 — Workspace updated
-
idstring (uuid)required -
namestringrequired -
slugstringrequired -
planstringrequired -
seatLimitintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme-corp",
"plan": "pro",
"seatLimit": 10,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
403 Insufficient permissions {
"code": "forbidden",
"message": "insufficient permissions"
} GET /workspaces/{wid}/usage Bearer JWT Get workspace usage stats
/workspaces/{wid}/usage Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Response 200 — Usage statistics
-
planstringrequired -
flagEvaluationsobjectrequired-
usedintegerrequired -
limitintegerrequired
-
-
flagsobjectrequired-
usedintegerrequired -
limitintegerrequired
-
-
membersobjectrequired-
usedintegerrequired -
limitintegerrequired
-
Example response
{
"plan": "pro",
"flagEvaluations": {
"used": 12500,
"limit": 100000
},
"flags": {
"used": 5,
"limit": 50
},
"members": {
"used": 3,
"limit": 10
}
} POST /workspaces/{wid}/leave Bearer JWT Leave a workspace
/workspaces/{wid}/leave Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Response 200 — Left workspace
-
statusstringrequired
Example response
{
"status": "ok"
} Members
Workspace member management
GET /workspaces/{wid}/members Bearer JWT List workspace members
/workspaces/{wid}/members Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Response 200 — List of members
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
userIdstring (uuid)required -
roleowner | admin | member | viewerrequired -
emailstring -
namestring -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "m1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"role": "admin",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] POST /workspaces/{wid}/members Bearer JWT Add a member to workspace
/workspaces/{wid}/members Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Request body
-
userIdstring (uuid)required -
roleowner | admin | member | viewerrequired
Response 201 — Member added
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
userIdstring (uuid)required -
roleowner | admin | member | viewerrequired -
emailstring -
namestring -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "m1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"role": "member",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} Errors
403 Insufficient permissions {
"code": "forbidden",
"message": "insufficient permissions"
} 409 Resource already exists {
"code": "conflict",
"message": "resource already exists"
} PATCH /workspaces/{wid}/members/{uid} Bearer JWT Update member role
/workspaces/{wid}/members/{uid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
uidrequired | string (uuid) | path | User ID |
Request body
-
roleowner | admin | member | viewerrequired
Response 200 — Member updated
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
userIdstring (uuid)required -
roleowner | admin | member | viewerrequired -
emailstring -
namestring -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "m1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"role": "admin",
"email": "[email protected]",
"name": "Jane Smith",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
403 Insufficient permissions {
"code": "forbidden",
"message": "insufficient permissions"
} DELETE /workspaces/{wid}/members/{uid} Bearer JWT Remove member from workspace
/workspaces/{wid}/members/{uid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
uidrequired | string (uuid) | path | User ID |
Response 200 — Member removed
-
statusstringrequired
Example response
{
"status": "ok"
} Errors
403 Insufficient permissions {
"code": "forbidden",
"message": "insufficient permissions"
} Projects
Project management
POST /workspaces/{wid}/projects Bearer JWT Create a project
/workspaces/{wid}/projects Bearer JWT Auto-provisions default environments (development, staging, production).
Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Request body
-
namestringrequired -
slugstringrequired
Response 201 — Project created
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
namestringrequired -
slugstringrequired -
environmentsEnvironment[]-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Web App",
"slug": "web-app",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} Errors
409 Resource already exists {
"code": "conflict",
"message": "resource already exists"
} GET /workspaces/{wid}/projects Bearer JWT List projects in workspace
/workspaces/{wid}/projects Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
Response 200 — List of projects
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
namestringrequired -
slugstringrequired -
environmentsEnvironment[]-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Web App",
"slug": "web-app",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] GET /projects/{pid} Bearer JWT Get project details
/projects/{pid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — Project details (includes environments)
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
namestringrequired -
slugstringrequired -
environmentsEnvironment[]-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Web App",
"slug": "web-app",
"environments": [
{
"id": "e1-dev-0000-0000-000000000001",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "development",
"name": "Development",
"color": "#22c55e",
"sortOrder": 0,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} PATCH /projects/{pid} Bearer JWT Update project
/projects/{pid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Request body
-
namestring
Response 200 — Project updated
-
idstring (uuid)required -
workspaceIdstring (uuid)required -
namestringrequired -
slugstringrequired -
environmentsEnvironment[]-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Web App",
"slug": "web-app",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Overview
Project overview statistics
GET /projects/{pid}/overview/stats Bearer JWT Get project statistics
/projects/{pid}/overview/stats Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — Project stats
-
totalFlagsintegerrequired -
activeFlagsintegerrequired -
inactiveFlagsintegerrequired -
recentlyModifiedintegerrequired -
healthIssuesintegerrequired
Example response
{
"totalFlags": 12,
"activeFlags": 8,
"inactiveFlags": 4,
"recentlyModified": 3,
"healthIssues": 1
} GET /projects/{pid}/overview/activity Bearer JWT Get recent project activity
/projects/{pid}/overview/activity Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
limit | integer | query | Number of activity items to return |
Response 200 — Recent activity
-
idstring (uuid)required -
actionstringrequired -
flagKeystringrequired -
flagNamestringrequired -
actorstringrequired -
environmentstringrequired -
environmentColorstring -
descriptionstringrequired -
timestampstring (date-time)required
Example response
[
{
"id": "ae1a2b3c-d5e6-7890-abcd-ef1234567890",
"action": "flag.toggled",
"flagKey": "new-checkout-flow",
"flagName": "New Checkout Flow",
"actor": "Jane Smith",
"environment": "production",
"environmentColor": "#ef4444",
"description": "Enabled flag in production",
"timestamp": "2025-01-15T14:22:00Z"
}
] GET /projects/{pid}/overview/health Bearer JWT Get project health issues
/projects/{pid}/overview/health Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — Health issues
-
flagIdstring (uuid)required -
flagKeystringrequired -
flagNamestringrequired -
typestringrequired -
severitystringrequired -
messagestringrequired
Example response
[
{
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"flagKey": "new-checkout-flow",
"flagName": "New Checkout Flow",
"type": "stale",
"severity": "warning",
"message": "Flag has not been modified in 90 days"
}
] Environments
Environment management
GET /projects/{pid}/environments Bearer JWT List project environments
/projects/{pid}/environments Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — List of environments
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "e3-prd-0000-0000-000000000003",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "production",
"name": "Production",
"color": "#ef4444",
"sortOrder": 2,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
] POST /projects/{pid}/environments Bearer JWT Create an environment
/projects/{pid}/environments Bearer JWT Auto-provisions flag_environments for all existing flags.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Request body
-
keystringrequired -
namestringrequired -
colorstring
Response 201 — Environment created
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "e3-prd-0000-0000-000000000003",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "production",
"name": "Production",
"color": "#ef4444",
"sortOrder": 2,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} GET /environments/{eid} Bearer JWT Get environment details
/environments/{eid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Response 200 — Environment details
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "e3-prd-0000-0000-000000000003",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "production",
"name": "Production",
"color": "#ef4444",
"sortOrder": 2,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} PATCH /environments/{eid} Bearer JWT Update environment
/environments/{eid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Request body
-
namestring -
colorstring
Response 200 — Environment updated
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequired -
namestringrequired -
colorstringrequired -
sortOrderintegerrequired -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "e3-prd-0000-0000-000000000003",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "production",
"name": "Production",
"color": "#ef4444",
"sortOrder": 2,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} DELETE /environments/{eid} Bearer JWT Delete environment
/environments/{eid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Response 200 — Environment deleted
-
statusstringrequired
Example response
{
"status": "ok"
} Flags
Feature flag management
POST /projects/{pid}/flags Bearer JWT Create a feature flag
/projects/{pid}/flags Bearer JWT Key must be kebab-case. Auto-provisions flag_environments for all project environments.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Request body
-
keystringrequiredMust be kebab-case
-
namestringrequired -
descriptionstring -
typeboolean | string | number | jsonrequired -
defaultValueanyValue when flag is enabled (defaults based on type)
-
offValueanyValue when flag is disabled (defaults based on type)
Response 201 — Flag created (includes environments)
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequiredKebab-case flag key
-
namestringrequired -
descriptionstring | null -
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredValue when flag is enabled but no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
archivedAtstring | null -
environmentsFlagEnvironment[]-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[] -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"type": "boolean",
"defaultValue": true,
"offValue": false,
"environments": [
{
"id": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"environmentKey": "production",
"environmentColor": "#ef4444",
"enabled": false,
"targetingRuleCount": 0,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} Errors
409 Resource already exists {
"code": "conflict",
"message": "resource already exists"
} 422 Validation failed {
"code": "unprocessable_entity",
"message": "validation failed"
} GET /projects/{pid}/flags Bearer JWT List flags in project
/projects/{pid}/flags Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — List of flags (includes environments and variants)
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequiredKebab-case flag key
-
namestringrequired -
descriptionstring | null -
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredValue when flag is enabled but no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
archivedAtstring | null -
environmentsFlagEnvironment[]-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[] -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"type": "boolean",
"defaultValue": true,
"offValue": false,
"environments": [
{
"id": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"environmentKey": "production",
"environmentColor": "#ef4444",
"enabled": true,
"targetingRuleCount": 1,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] GET /projects/{pid}/flags/stream Bearer JWT Stream flag changes for console (SSE)
/projects/{pid}/flags/stream Bearer JWT Server-Sent Events stream for real-time flag updates in the console dashboard.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
GET /flags/{fid} Bearer JWT Get flag details
/flags/{fid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
fidrequired | string (uuid) | path | Flag ID |
Response 200 — Flag details (includes environments and variants)
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequiredKebab-case flag key
-
namestringrequired -
descriptionstring | null -
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredValue when flag is enabled but no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
archivedAtstring | null -
environmentsFlagEnvironment[]-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[] -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"type": "boolean",
"defaultValue": true,
"offValue": false,
"environments": [
{
"id": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"environmentKey": "production",
"environmentColor": "#ef4444",
"enabled": true,
"targetingRuleCount": 1,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} PATCH /flags/{fid} Bearer JWT Update flag metadata
/flags/{fid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
fidrequired | string (uuid) | path | Flag ID |
Request body
-
namestring -
descriptionstring
Response 200 — Flag updated
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequiredKebab-case flag key
-
namestringrequired -
descriptionstring | null -
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredValue when flag is enabled but no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
archivedAtstring | null -
environmentsFlagEnvironment[]-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[] -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"type": "boolean",
"defaultValue": true,
"offValue": false,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} POST /flags/{fid}/archive Bearer JWT Archive a flag
/flags/{fid}/archive Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
fidrequired | string (uuid) | path | Flag ID |
Response 200 — Flag archived
-
idstring (uuid)required -
projectIdstring (uuid)required -
keystringrequiredKebab-case flag key
-
namestringrequired -
descriptionstring | null -
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredValue when flag is enabled but no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
archivedAtstring | null -
environmentsFlagEnvironment[]-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[] -
createdAtstring (date-time)required -
updatedAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"type": "boolean",
"defaultValue": true,
"offValue": false,
"archivedAt": "2025-01-15T14:22:00Z",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Flag Environments
Per-environment flag configuration (toggle, variants, promote)
PUT /flag-environments/{feid} Bearer JWT Update flag environment config (enable/disable, rollout)
/flag-environments/{feid} Bearer JWT Use this to toggle a flag on/off in a specific environment.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
feidrequired | string (uuid) | path | Flag environment ID |
Request body
-
enabledboolean -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger
Response 200 — Flag environment updated
-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[]-
idstring (uuid)required -
flagEnvironmentIdstring (uuid)required -
keystringrequired -
valueanyrequiredVariant value (type matches flag type)
-
weightintegerrequiredPercentage weight (all variant weights should sum to 100)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"environmentKey": "production",
"environmentColor": "#ef4444",
"enabled": true,
"rolloutPercentage": 50,
"targetingRuleCount": 1,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} PUT /flag-environments/{feid}/variants Bearer JWT Set flag variants (replace all)
/flag-environments/{feid}/variants Bearer JWT Replaces all existing variants.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
feidrequired | string (uuid) | path | Flag environment ID |
Request body
-
variantsVariantInput[]-
keystringrequired -
valueanyrequiredVariant value
-
weightinteger
-
Response 200 — Variants set
-
idstring (uuid)required -
flagEnvironmentIdstring (uuid)required -
keystringrequired -
valueanyrequiredVariant value (type matches flag type)
-
weightintegerrequiredPercentage weight (all variant weights should sum to 100)
-
createdAtstring (date-time)required
Example response
[
{
"id": "v1a2b3c4-d5e6-7890-abcd-ef1234567890",
"flagEnvironmentId": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"key": "variant-a",
"value": true,
"weight": 50,
"createdAt": "2025-01-15T14:22:00Z"
}
] POST /flag-environments/{feid}/promote Bearer JWT Promote flag config to another environment
/flag-environments/{feid}/promote Bearer JWT Copies enabled state, value override, rollout percentage, and variants.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
feidrequired | string (uuid) | path | Flag environment ID |
Request body
-
targetEnvironmentIdstring (uuid)required
Response 200 — Config promoted
-
idstring (uuid)required -
flagIdstring (uuid)required -
flagKeystring -
environmentIdstring (uuid)required -
environmentKeystring -
environmentColorstring -
enabledbooleanrequired -
valueOverrideanyEnvironment-specific value override
-
rolloutPercentageinteger | null -
targetingRuleCountintegerrequired -
variantsFlagVariant[]-
idstring (uuid)required -
flagEnvironmentIdstring (uuid)required -
keystringrequired -
valueanyrequiredVariant value (type matches flag type)
-
weightintegerrequiredPercentage weight (all variant weights should sum to 100)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"environmentKey": "production",
"environmentColor": "#ef4444",
"enabled": true,
"rolloutPercentage": 100,
"targetingRuleCount": 1,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Segments
User segment management
POST /projects/{pid}/segments Bearer JWT Create a user segment
/projects/{pid}/segments Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Request body
-
namestringrequired -
matchTypeALL | ANYrequired -
rulesSegmentRuleInput[]-
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value
-
Response 201 — Segment created
-
idstring (uuid)required -
projectIdstring (uuid)required -
namestringrequired -
matchTypeALL | ANYrequiredALL = AND logic, ANY = OR logic
-
rulesSegmentRule[]-
idstring (uuid)required -
segmentIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value (type depends on operator)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Beta Users",
"matchType": "ALL",
"rules": [
{
"id": "sr1a2b3c-d5e6-7890-abcd-ef1234567890",
"segmentId": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"attribute": "plan",
"operator": "equals",
"value": "pro",
"createdAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
} GET /projects/{pid}/segments Bearer JWT List segments in project
/projects/{pid}/segments Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
pidrequired | string (uuid) | path | Project ID |
Response 200 — List of segments
-
idstring (uuid)required -
projectIdstring (uuid)required -
namestringrequired -
matchTypeALL | ANYrequiredALL = AND logic, ANY = OR logic
-
rulesSegmentRule[]-
idstring (uuid)required -
segmentIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value (type depends on operator)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Beta Users",
"matchType": "ALL",
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] GET /segments/{sid} Bearer JWT Get segment details
/segments/{sid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
sidrequired | string (uuid) | path | Segment ID |
Response 200 — Segment details (includes rules)
-
idstring (uuid)required -
projectIdstring (uuid)required -
namestringrequired -
matchTypeALL | ANYrequiredALL = AND logic, ANY = OR logic
-
rulesSegmentRule[]-
idstring (uuid)required -
segmentIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value (type depends on operator)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Beta Users",
"matchType": "ALL",
"rules": [
{
"id": "sr1a2b3c-d5e6-7890-abcd-ef1234567890",
"segmentId": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"attribute": "plan",
"operator": "equals",
"value": "pro",
"createdAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} PATCH /segments/{sid} Bearer JWT Update segment
/segments/{sid} Bearer JWT Replaces all rules.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
sidrequired | string (uuid) | path | Segment ID |
Request body
-
namestring -
matchTypeALL | ANY -
rulesSegmentRuleInput[]-
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value
-
Response 200 — Segment updated
-
idstring (uuid)required -
projectIdstring (uuid)required -
namestringrequired -
matchTypeALL | ANYrequiredALL = AND logic, ANY = OR logic
-
rulesSegmentRule[]-
idstring (uuid)required -
segmentIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value (type depends on operator)
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"id": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"projectId": "p1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Beta Users",
"matchType": "ALL",
"rules": [
{
"id": "sr1a2b3c-d5e6-7890-abcd-ef1234567890",
"segmentId": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"attribute": "plan",
"operator": "equals",
"value": "pro",
"createdAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} DELETE /segments/{sid} Bearer JWT Delete segment
/segments/{sid} Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
sidrequired | string (uuid) | path | Segment ID |
Response 200 — Segment deleted
-
statusstringrequired
Example response
{
"status": "ok"
} Targeting
Targeting rules for flag environments
GET /flag-environments/{feid}/targeting-rules Bearer JWT Get targeting rules for flag environment
/flag-environments/{feid}/targeting-rules Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
feidrequired | string (uuid) | path | Flag environment ID |
Response 200 — List of targeting rules
-
idstring (uuid)required -
flagEnvironmentIdstring (uuid)required -
priorityintegerrequiredEvaluation order (lower = evaluated first)
-
segmentIdstring | nullReference to a reusable segment
-
valueOverrideanyValue to serve when rule matches
-
rolloutPercentageinteger | nullPercentage of matching users who get valueOverride (murmur3 consistent hashing)
-
rolloutSaltstring | nullCustom salt for rollout bucketing (defaults to flag key)
-
enabledbooleanrequired -
matchTypeALL | ANYrequiredHow inline conditions are combined
-
conditionsTargetingCondition[]-
idstring (uuid)required -
targetingRuleIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "tr1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagEnvironmentId": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"priority": 1,
"segmentId": "s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"valueOverride": true,
"rolloutPercentage": 100,
"enabled": true,
"matchType": "ALL",
"conditions": [
{
"id": "tc1a2b3c-d5e6-7890-abcd-ef1234567890",
"targetingRuleId": "tr1a2b3c-d5e6-7890-abcd-ef1234567890",
"attribute": "plan",
"operator": "equals",
"value": "pro",
"createdAt": "2025-01-15T10:30:00Z"
}
],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] PUT /flag-environments/{feid}/targeting-rules Bearer JWT Set targeting rules (replace all)
/flag-environments/{feid}/targeting-rules Bearer JWT Replaces all existing targeting rules. Rules are evaluated in order of priority.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
feidrequired | string (uuid) | path | Flag environment ID |
Request body
-
rulesTargetingRuleInput[]-
segmentIdstring | null -
valueOverrideanyValue to serve when rule matches
-
rolloutPercentageinteger -
rolloutSaltstring -
enabledboolean -
matchTypeALL | ANY -
conditionsTargetingConditionInput[]
-
Response 200 — Targeting rules set
-
idstring (uuid)required -
flagEnvironmentIdstring (uuid)required -
priorityintegerrequiredEvaluation order (lower = evaluated first)
-
segmentIdstring | nullReference to a reusable segment
-
valueOverrideanyValue to serve when rule matches
-
rolloutPercentageinteger | nullPercentage of matching users who get valueOverride (murmur3 consistent hashing)
-
rolloutSaltstring | nullCustom salt for rollout bucketing (defaults to flag key)
-
enabledbooleanrequired -
matchTypeALL | ANYrequiredHow inline conditions are combined
-
conditionsTargetingCondition[]-
idstring (uuid)required -
targetingRuleIdstring (uuid)required -
attributestringrequired -
operatorequals | not_equals | contains | not_contains | starts_with | ends_with | in | not_in | gt | ltrequired -
valueanyrequiredComparison value
-
createdAtstring (date-time)required
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"id": "tr1a2b3c-d5e6-7890-abcd-ef1234567890",
"flagEnvironmentId": "fe1a2b3c-d5e6-7890-abcd-ef1234567890",
"priority": 1,
"valueOverride": true,
"rolloutPercentage": 100,
"enabled": true,
"matchType": "ALL",
"conditions": [
{
"id": "tc1a2b3c-d5e6-7890-abcd-ef1234567890",
"targetingRuleId": "tr1a2b3c-d5e6-7890-abcd-ef1234567890",
"attribute": "plan",
"operator": "equals",
"value": "pro",
"createdAt": "2025-01-15T14:22:00Z"
}
],
"createdAt": "2025-01-15T14:22:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] API Keys
API key generation and management
POST /environments/{eid}/keys Bearer JWT Generate a publishable + secret key pair
/environments/{eid}/keys Bearer JWT Returns full key values only once.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Response 201 — Key pair generated
-
publishableKeystringrequiredFull publishable key value (shown only once)
-
secretKeystringrequiredFull secret key value (shown only once)
-
publishableobjectrequired-
idstring (uuid)required -
environmentIdstring (uuid)required -
typepublishable | secretrequired -
prefixstringrequiredKey prefix for identification (e.g. pk_live_abc...)
-
lastUsedAtstring | null -
revokedAtstring | null -
createdBystring (uuid)required -
createdAtstring (date-time)required
-
-
secretobjectrequired-
idstring (uuid)required -
environmentIdstring (uuid)required -
typepublishable | secretrequired -
prefixstringrequiredKey prefix for identification (e.g. pk_live_abc...)
-
lastUsedAtstring | null -
revokedAtstring | null -
createdBystring (uuid)required -
createdAtstring (date-time)required
-
Example response
{
"publishableKey": "pk_prod_AbC12xYz_Y2xpZW50",
"secretKey": "sk_prod_XyZ98aBc_c2VjcmV0",
"publishable": {
"id": "k1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"type": "publishable",
"prefix": "pk_prod_AbC12xYz",
"createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"createdAt": "2025-01-15T10:30:00Z"
},
"secret": {
"id": "k2b3c4d5-e6f7-8901-bcde-f12345678901",
"environmentId": "e3-prd-0000-0000-000000000003",
"type": "secret",
"prefix": "sk_prod_XyZ98aBc",
"createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"createdAt": "2025-01-15T10:30:00Z"
}
} GET /environments/{eid}/keys Bearer JWT List API keys for environment
/environments/{eid}/keys Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Response 200 — List of API keys (prefix only, not full values)
-
idstring (uuid)required -
environmentIdstring (uuid)required -
typepublishable | secretrequired -
prefixstringrequiredKey prefix for identification (e.g. pk_live_abc...)
-
lastUsedAtstring | null -
revokedAtstring | null -
createdBystring (uuid)required -
createdAtstring (date-time)required
Example response
[
{
"id": "k1a2b3c4-d5e6-7890-abcd-ef1234567890",
"environmentId": "e3-prd-0000-0000-000000000003",
"type": "publishable",
"prefix": "pk_prod_AbC12xYz",
"createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"createdAt": "2025-01-15T10:30:00Z"
}
] POST /environments/{eid}/keys/{kid}/revoke Bearer JWT Revoke a specific API key
/environments/{eid}/keys/{kid}/revoke Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
kidrequired | string (uuid) | path | API key ID |
Response 200 — Key revoked
-
statusstringrequired
Example response
{
"status": "ok"
} POST /environments/{eid}/keys/revoke Bearer JWT Revoke all API keys for environment
/environments/{eid}/keys/revoke Bearer JWT Parameters
| Name | Type | In | Description |
|---|---|---|---|
eidrequired | string (uuid) | path | Environment ID |
Response 200 — All keys revoked
-
statusstringrequired
Example response
{
"status": "ok"
} Audit
Audit log
GET /workspaces/{wid}/audit Bearer JWT List audit events
/workspaces/{wid}/audit Bearer JWT (admin role).
Parameters
| Name | Type | In | Description |
|---|---|---|---|
widrequired | string (uuid) | path | Workspace ID |
cursor | string | query | Cursor for pagination (from `nextCursor` in previous response) |
limit | integer | query | Number of events to return |
Response 200 — Paginated audit events
-
dataAuditEvent[]required-
idstring (uuid)required -
workspaceIdstring (uuid)required -
actorUserIdstring (uuid)required -
actionstringrequired -
resourceTypestringrequired -
resourceIdstring (uuid)required -
metadataobject | null -
ipstring | null -
createdAtstring (date-time)required
-
-
nextCursorstring -
hasMorebooleanrequired
Example response
{
"data": [
{
"id": "ae1a2b3c-d5e6-7890-abcd-ef1234567890",
"workspaceId": "w1a2b3c4-d5e6-7890-abcd-ef1234567890",
"actorUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"action": "flag.toggled",
"resourceType": "flag",
"resourceId": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"metadata": {
"enabled": true,
"environment": "production"
},
"createdAt": "2025-01-15T14:22:00Z"
}
],
"hasMore": false
} Errors
403 Insufficient permissions {
"code": "forbidden",
"message": "insufficient permissions"
} Evaluation
Flag evaluation endpoints for SDKs (API-key auth)
GET /eval/flags API Key List all evaluated flags for environment
/eval/flags API Key Returns all flags with their current values for the environment associated with the API key. Rate limited to 100 req/sec per key.
Response 200 — List of evaluated flags
-
keystringrequired -
namestringrequired -
valueanyrequiredCurrent evaluated value (type matches flag type)
-
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredDefault value when enabled and no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
enabledbooleanrequired -
rolloutPercentageinteger | null -
variantsEvaluatedVariant[]-
keystringrequired -
valueanyrequiredVariant value
-
weightintegerrequired
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"value": true,
"type": "boolean",
"defaultValue": true,
"offValue": false,
"enabled": true,
"rolloutPercentage": 100,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] Errors
401 Authentication required or invalid {
"code": "unauthorized",
"message": "authentication required"
} 429 Rate limit exceeded {
"code": "too_many_requests",
"message": "rate limit exceeded"
} POST /eval/flags/evaluate API Key Evaluate all flags with user context
/eval/flags/evaluate API Key Evaluates all flags in the environment using targeting rules, segments, and rollout percentages against the provided user context.
Request body
-
userIdstringrequiredUnique user identifier for targeting and rollout bucketing
-
attributesobjectUser attributes for segment/targeting evaluation (e.g. plan, country, role)
Response 200 — All flags evaluated
-
keystringrequired -
namestringrequired -
valueanyrequiredCurrent evaluated value (type matches flag type)
-
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredDefault value when enabled and no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
enabledbooleanrequired -
rolloutPercentageinteger | null -
variantsEvaluatedVariant[]-
keystringrequired -
valueanyrequiredVariant value
-
weightintegerrequired
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
[
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"value": true,
"type": "boolean",
"defaultValue": true,
"offValue": false,
"enabled": true,
"rolloutPercentage": 100,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
}
] GET /eval/flags/{key} API Key Get a single evaluated flag by key
/eval/flags/{key} API Key Parameters
| Name | Type | In | Description |
|---|---|---|---|
keyrequired | string | path | Flag key (kebab-case) |
Response 200 — Evaluated flag
-
keystringrequired -
namestringrequired -
valueanyrequiredCurrent evaluated value (type matches flag type)
-
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredDefault value when enabled and no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
enabledbooleanrequired -
rolloutPercentageinteger | null -
variantsEvaluatedVariant[]-
keystringrequired -
valueanyrequiredVariant value
-
weightintegerrequired
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"value": true,
"type": "boolean",
"defaultValue": true,
"offValue": false,
"enabled": true,
"rolloutPercentage": 100,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} POST /eval/flags/{key}/evaluate API Key Evaluate a single flag with user context
/eval/flags/{key}/evaluate API Key Evaluates a specific flag using targeting rules, segments, and rollout percentages against the provided user context. Uses murmur3 consistent hashing for rollout bucketing.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
keyrequired | string | path | Flag key (kebab-case) |
Request body
-
userIdstringrequiredUnique user identifier for targeting and rollout bucketing
-
attributesobjectUser attributes for segment/targeting evaluation (e.g. plan, country, role)
Response 200 — Flag evaluated
-
keystringrequired -
namestringrequired -
valueanyrequiredCurrent evaluated value (type matches flag type)
-
typeboolean | string | number | jsonrequired -
defaultValueanyrequiredDefault value when enabled and no targeting rule matches
-
offValueanyrequiredValue when flag is disabled
-
enabledbooleanrequired -
rolloutPercentageinteger | null -
variantsEvaluatedVariant[]-
keystringrequired -
valueanyrequiredVariant value
-
weightintegerrequired
-
-
createdAtstring (date-time)required -
updatedAtstring (date-time)required
Example response
{
"key": "new-checkout-flow",
"name": "New Checkout Flow",
"value": true,
"type": "boolean",
"defaultValue": true,
"offValue": false,
"enabled": true,
"rolloutPercentage": 100,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T14:22:00Z"
} Errors
404 Resource not found {
"code": "not_found",
"message": "resource not found"
} GET /eval/flags/stream API Key Stream flag changes (SSE)
/eval/flags/stream API Key