Configure flag environment
Opts a flag into a project environment and sets the fallback value served when no targeting rule matches.
PUThttps://api.featuregate.dev/v1/projects/{projectId}/flags/{flagKey}/environments/{environmentKey}
Authenticate with a management automation key in the Authorization header.management:flags:write
Path parameters
projectIdstringrequired
Stable project_ identifier.
Pattern: ^project_.+
flagKeystringrequired
Lowercase letters, numbers, and hyphens only.
Length: 1-80Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
environmentKeystringrequired
Lowercase letters, numbers, and hyphens only.
Length: 1-80Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
Body parameters
defaultValueboolean | string | number | objectrequired
Typed fallback value for this flag/environment pair.
Request
sh
curl -X PUT https://api.featuregate.dev/v1/projects/project_example/flags/new-checkout/environments/production \
-H "Authorization: Bearer fg_ak_test_0123456789abcdef0123456789abcdef0123456789abcdef" \
-H "Content-Type: application/json" \
-d '{
"defaultValue": false
}'Returns
flagEnvironmentConfigobjectrequired
idstringrequired
Stable flag-environment config identifier.
Length: 1+
flagIdstringrequired
Owning flag identifier.
Length: 1+
environmentIdstringrequired
Owning environment identifier.
Length: 1+
defaultValueboolean | string | number | objectrequired
Environment fallback value.
createdAtstringrequired
Config creation timestamp.
updatedAtstringrequired
Last config update timestamp.
Responses
200The created or updated flag environment configuration.
400Validation failed.
401Authentication failed.
403The key is not allowed to access this resource.
429Rate limit exceeded.
500Unexpected server error.