Membership is per application. The creator becomes owner automatically.
owner | Full control, including deleting the application and transferring ownership. Only one owner at a time. |
admin | Everything a moderator can do, plus managing members. |
moderator | Can change flag settings: create/update/archive flags, configs, rules, and experiments. |
viewer | Read-only access to the application, its flags, and configuration. |
Creating and listing applications only requires a valid JWT for the tenant; every other endpoint requires application membership at the noted role or higher.
Lists applications the caller is a member of, including their role.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
{
"applications": [
{
"id": 3,
"key": "storefront",
"name": "Storefront",
"role": "owner"
}
]
}
Creates an application. The caller becomes its owner.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{
"key": "storefront",
"name": "Storefront",
"description": "Customer-facing web app"
}
Response
{
"application": {
"id": 3,
"key": "storefront",
"name": "Storefront",
"ownerUserSub": "user_123",
"role": "owner"
}
}
Returns an application. Requires viewer role or higher.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
{
"application": {
"id": 3,
"key": "storefront",
"name": "Storefront",
"role": "viewer"
}
}
Updates name or description. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{ "description": "Updated description" }
Response
{
"application": {
"id": 3,
"description": "Updated description"
}
}
Deletes the application and its flags, configs, and rules. Owner only.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
204 No Content
Lists members and their roles. Requires viewer role or higher.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
{
"members": [
{
"userSub": "user_123",
"role": "owner"
}
]
}
Adds a member with role admin, moderator, or viewer. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{ "userSub": "user_456", "role": "moderator" }
Response
{
"member": {
"userSub": "user_456",
"role": "moderator"
}
}
Changes a member role to admin, moderator, or viewer. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{ "role": "admin" }
Response
{
"member": {
"userSub": "user_456",
"role": "admin"
}
}
Removes a member. The owner cannot be removed. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
204 No Content
Transfers ownership to an existing member; the previous owner becomes admin. Owner only.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{ "userSub": "user_456" }
Response
{
"ownerUserSub": "user_456"
}
Runtime callers (POST /flags/:flagKey/evaluate and POST /events/:eventKey) authenticate with an API key instead of a tenant id, so internal ids are never exposed to client applications. The server looks up the tenant and application from the key on every request.
Lists keys with a masked prefix only. Requires viewer role or higher.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
{
"apiKeys": [
{
"id": 1,
"name": "Production runtime key",
"keyPrefix": "ak_3f9a2b",
"isActive": true,
"lastUsedAt": null
}
]
}
Creates a read-only runtime key. The plaintext key is only ever returned in this response; store it immediately. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid
Authorization: Bearer <admin-jwt>
{ "name": "Production runtime key" }
Response
{
"apiKey": {
"id": 1,
"name": "Production runtime key",
"keyPrefix": "ak_3f9a2b",
"isActive": true,
"key": "ak_3f9a2b7c1d..."
}
}
Permanently revokes a key; runtime calls using it immediately start failing with 401. Requires admin role or higher.
Request
X-Tenant-ID: tenant-uuid Authorization: Bearer <admin-jwt>
Response
204 No Content