Skip to content

Environments API

Base path: /api/environments. Requires the token auth cookie.

Rotate an environment's SDK key

PATCH /api/environments/:envId/rotate-key

Generates a new SDK key, immediately invalidates the old key in the Redis cache, and pre-populates the cache for the new key. Writes an audit log entry (key_rotation, domain environment). Returns the new SDK key as a plain JSON string.

WARNING

The old SDK key stops working the instant this call succeeds. Any SDK/SSE clients using it will get 401 Invalid sdk key on their next request and should be updated to the new key.

List all flags for an environment

GET /api/environments/:envId/flags

Returns every flag and its per-environment value for the given environment — this is the same data shape used to render the dashboard's flags table, not the lean shape returned by the SDK endpoint.