Skip to main content
The Admin API is the write-side surface for managing flags, environments, targeting rules, rollouts, and audit logs. It is authenticated with a Supabase JWT (obtained via POST /auth/login).

Authentication

Admin endpoints require a Supabase JWT in the Authorization header:
Obtain a JWT by logging in:
Response 200 OK:
Log out with:
Returns 204 No Content.

Environments

Create an environment

Response 201 Created:
The sdkKey is returned only once at creation time. Copy it into your secrets manager immediately — it cannot be retrieved again.
Behind the scenes:
  • A new environments row is inserted with a SHA-256 hash of the SDK key (plaintext is never persisted).
  • A sdkKeyPrefix is extracted for dashboard display.
  • All existing active flags are auto-initialized for this environment with isEnabled: false.
  • An ENVIRONMENT_CREATED audit log entry is written in the same transaction.

List environments

Response 200 OK:

Get an environment

Update an environment

Rename an environment (PATCH with { "name": "new-name" }):

Revoke an environment

Revokes an environment, making its SDK key inactive. Revoked environments cannot be evaluated by SDKs.
Response 200 OK — returns the revoked environment object with status: "revoked".

Rotate an SDK key

Rotates the SDK key for an environment. This revokes the old environment (status set to revoked) and creates a new active environment with the same product and name, migrating all flag configurations, targeting rules, and rollout configurations to the new environment. The new plaintext SDK key is returned only once.
Response 201 Created:
Rotation invalidates the old key immediately. Update the key in your secrets manager and restart/re-deploy affected services before relying on the new key.

Feature flags

Create a flag

Response 201 Created:
Boolean flags are fully supported by the evaluation engine. String and multivariate types can be created, but the current evaluation engine only resolves boolean results — isEnabled() always returns true or false.

List flags

Get a flag

Update a flag

Archive a flag

Archived flags are retained for auditing. A flag cannot be archived while it is enabled in any environment. Returns 409 Conflict if so.

Flag environment configuration

Get configuration

Response 200 OK:

Create or replace configuration

Behind the scenes: Updates feature_flag_environments, writes a FLAG_ENVIRONMENT_UPDATED audit entry, and invalidates the Redis cache for this flag + environment.

Targeting rules

Create a rule

Each condition uses a discriminated union — exactly one value field, determined by valueType:
Only flat and/or logic is supported. Nested condition groups (e.g. (A AND B) OR (C AND D)) are not currently representable — use multiple prioritized rules instead.

List rules

Returns rules ordered by priority ASC.

Replace a rule

Delete a rule

Rollouts

Get rollout configuration

Create or update rollout

Returns 201 Created on insert, 200 OK on update.

Delete rollout

Audit logs

Response 200 OK:

Audit actions

Admin API endpoint summary