Feature flags in Swisstools are organized at two levels. Global flags apply project-wide with an on/off toggle and an optional rollout percentage. Flag groups let you define a reusable set of flags (group flags) and then apply them to individual records — users, organizations, or any entity you identify — with per-record overrides. The SDK endpoint resolves all flag values for a record using an API key, so your application can fetch flag state at runtime without a session cookie. Every endpoint below is project-scoped and accepts either a dashboard session cookie or a project API key (Documentation Index
Fetch the complete documentation index at: https://docs.swisstools.dev/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer fk_… or the x-api-key header) — API keys are project-admin equivalent. The SDK endpoint (GET /api/flags/:recordId) is the one route that requires an API key. See Authentication for details.
Project, flag, group, record, and environment IDs in these paths are public reference IDs (KSUIDs, ~27 chars) shown in the dashboard — the internal database UUID is not accepted in URLs.
Flags and records resolve against an environment. Pass an optional ?env= query parameter (the environment’s key such as production, or its display name, case-insensitive) on read and check endpoints; when omitted, the project’s default environment is used.
Global Flags
List Flags
GET /api/projects/:projectId/flags
Returns all global feature flags for the project, scoped to an environment.
Path Parameters
The project’s public reference ID (KSUID), shown in Project settings → General.
Optional environment selector (the environment’s
key or name). Defaults to the project’s default environment; an unknown value returns [].Create Flag
POST /api/projects/:projectId/flags
Creates a new global feature flag.
Path Parameters
The project’s public reference ID (KSUID), shown in Project settings → General.
Display name for the flag.
Optional user-supplied public reference ID (
^[A-Za-z0-9_-]{1,128}$). Stored as-is and must be unique across the project’s flags. When omitted, a KSUID is generated.A unique, URL-friendly identifier for the flag within this project (e.g.,
dark-mode). Defaults to a slug of name when omitted. Must be unique per project and environment.Whether the flag is active. Defaults to
false.Rollout percentage from
0 to 100. Defaults to 100.Environment the flag is created in (accepts an environment
key or name). Defaults to the project’s default environment.201 Created
Get Flag
GET /api/projects/:projectId/flags/:flagId
Returns a single global flag by its ID.
Path Parameters
The project’s public reference ID (KSUID), shown in Project settings → General.
The flag’s public reference ID — a KSUID, or the value you supplied as
id when creating the flag.Update Flag
PUT /api/projects/:projectId/flags/:flagId
Updates a global flag’s name, enabled state, or rollout percentage.
Path Parameters
The project’s public reference ID (KSUID), shown in Project settings → General.
The flag’s public reference ID — a KSUID, or the value you supplied as
id when creating the flag.Updated display name.
Updated enabled state.
Updated rollout percentage.
Delete Flag
DELETE /api/projects/:projectId/flags/:flagId
Permanently deletes a global flag.
Request
Check Flag
GET /api/projects/:projectId/flags/check/:flagKey
Checks whether a global flag is currently enabled by its key. Useful for server-side flag resolution without going through the SDK.
Path Parameters
The project’s public reference ID (KSUID), shown in Project settings → General.
The
key value of the flag (e.g., dark-mode).Optional environment selector (the environment’s
key or name, case-insensitive). Defaults to the project’s default environment; an unknown value returns 404. Results are cached for 60 seconds in Redis per (project, flagKey, env).enabled already reflects the rollout roll. source is "cache" when served from the Redis cache or "global" when freshly computed.
Flag Groups
Groups are reusable collections of flags that you attach to records (users, orgs, etc.). Each group has its own set of group flags with default values; records in the group can override any flag’s value.List Groups
GET /api/projects/:projectId/groups
Request
Create Group
POST /api/projects/:projectId/groups
Request Body
Display name for the group.
Unique identifier for the group within this project. Defaults to a slug of
name when omitted.A 2–5 character lowercase alphanumeric prefix used to namespace auto-generated record IDs in this group (e.g.,
beta). Must be unique per project. Auto-derived from name when omitted.Optional description for the group.
Optional hex color used as the group’s label in the dashboard (e.g.,
#8C7AB0).201 Created
Get Group
GET /api/projects/:projectId/groups/:groupId
Request
Update Group
PUT /api/projects/:projectId/groups/:groupId
Request Body
Updated display name.
Updated key.
Updated prefix.
Delete Group
DELETE /api/projects/:projectId/groups/:groupId
Request
Group Flags
Group flags are the individual flags within a group. Each has adefaultEnabled and defaultPercentage that applies to all records unless overridden.
List Group Flags
GET /api/projects/:projectId/groups/:groupId/flags
Request
Create Group Flag
POST /api/projects/:projectId/groups/:groupId/flags
Request Body
Display name for the flag.
Unique identifier within the group.
Default enabled state for records that have no override. Defaults to
false.Default rollout percentage. Defaults to
100.201 Created
Group Records
Records represent the entities (users, organizations, devices, etc.) that belong to a group. Each record’sid is either a stable identifier you supply from your own system, or — when you omit it — an auto-generated {groupPrefix}-{ksuid} value (e.g., beta-2a9bX1c0d3e4f5g6h7i8j9k0).
List Records
GET /api/projects/:projectId/groups/:groupId/records
Request
Create Record
POST /api/projects/:projectId/groups/:groupId/records
Adds a record (entity) to the group.
Request Body
Optional stable identifier from your own system (
^[A-Za-z0-9_-]{1,128}$), stored verbatim and unique across all records. When omitted, the server generates {groupPrefix}-{ksuid}. Supplying your own entity ID lets SDK callers resolve flags via GET /api/flags/{yourId} directly.Optional human-readable label for this record, shown in the dashboard.
Optional JSON object with arbitrary key-value pairs (e.g., plan, region, cohort).
id (e.g. -d '{"name": "Alice"}'); the response id will be {groupPrefix}-{ksuid}.
Response — 201 Created
Environments
Flags and overrides are scoped to environments (e.g.production, staging). Reference an environment by its key or name via the ?env= query parameter on read/check endpoints; omitting it uses the project’s default environment.
List Environments
GET /api/projects/:projectId/environments
Create Environment
POST /api/projects/:projectId/environments
Request Body
Display name for the environment (e.g.,
Staging).URL-friendly identifier (e.g.,
staging). Defaults to a slug of name.Whether this becomes the project’s default environment. Defaults to
false.Per-Record Overrides
Set or clear an individual record’s value for a group flag in a given environment:PUT /api/projects/:projectId/groups/:groupId/records/:recordId/values/:groupFlagId
GET /api/projects/:projectId/records/:recordId/values.
SDK Endpoint
GET /api/flags/:recordId
Resolves all feature flag values for a given record. This endpoint uses API key bearer auth rather than a session cookie, so you can call it from your backend or edge functions at runtime.
The response maps each group flag key to its resolved value for the specified record and environment, taking per-record overrides into account. enabled is the final decision — the server applies the rollout dice-roll, so a flag that is on but outside the rollout returns enabled: false.
Path Parameters
The ID of the record whose flags you want to resolve — the auto-generated
{groupPrefix}-{ksuid} form or the value you supplied as id. Must belong to the same project as the API key.Optional environment selector (the environment’s
key or name). Defaults to the project’s default environment. If it doesn’t match any environment, environment is null and flags is {}.source is "record" when the value comes from a per-record override, or "group-default" when it falls back to the group flag’s defaultEnabled / defaultPercentage.