FeatureGate

Create flag

Creates a flag definition in a visible project. Configure environments separately before it is served.

POSThttps://api.featuregate.dev/v1/projects/{projectId}/flags
Authenticate with a management automation key in the Authorization header.management:flags:write

Path parameters

projectIdstringrequired

Stable project_ identifier.

Pattern: ^project_.+

Body parameters

keystringrequired

Developer-facing flag key, unique inside the project.

Length: 1-80

namestringrequired

Human-readable flag name.

Length: 1-120

descriptionstring | nulloptional

Optional internal description shown in management surfaces.

Length: up to 240

type"boolean" | "string" | "number" | "object"optional

Typed value family for this flag.

Default: booleanOptions: boolean, string, number, object

lifecycleKind"temporary" | "permanent"optional

Whether the flag should be reviewed for cleanup or treated as permanent.

Default: temporaryOptions: temporary, permanent

intent"release" | "ops" | "permission" | "experiment" | "configuration" | "maintenance"optional

Why the flag exists.

Default: releaseOptions: release, ops, permission, experiment, configuration, maintenance

cleanupTargetAtstring | nulloptional

Cleanup review timestamp for temporary flags.

cleanupNotestring | nulloptional

Optional cleanup guidance for temporary flags.

Length: up to 500

Request
sh
curl -X POST https://api.featuregate.dev/v1/projects/project_example/flags \
  -H "Authorization: Bearer fg_ak_test_0123456789abcdef0123456789abcdef0123456789abcdef" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "new-checkout",
  "name": "New checkout",
  "type": "boolean"
}'

Returns

flagobjectrequired
idstringrequired

Stable flag identifier, prefixed with flag_.

Length: 1+

createdAtstringrequired

Flag creation timestamp.

updatedAtstringrequired

Last flag update timestamp.

archivedAtstring | nullrequired

Archive timestamp, or null while active.

projectIdstringrequired

Owning project identifier.

Length: 1+

keystringrequired

Developer-facing flag key.

Length: 1+

namestringrequired

Human-readable flag name.

Length: 1+

descriptionstring | nullrequired

Optional internal description.

type"boolean" | "string" | "number" | "object"required

Flag value type.

Options: boolean, string, number, object

lifecycleKind"temporary" | "permanent"required

Flag lifecycle classification.

Options: temporary, permanent

intent"release" | "ops" | "permission" | "experiment" | "configuration" | "maintenance"required

Flag intent classification.

Options: release, ops, permission, experiment, configuration, maintenance

cleanupTargetAtstring | nullrequired

Cleanup review timestamp, when set.

cleanupNotestring | nullrequired

Optional cleanup guidance.

Responses

201The created flag.
400Validation failed.
401Authentication failed.
403The key is not allowed to access this resource.
429Rate limit exceeded.
500Unexpected server error.