Skip to content

Configurations

Configurations let you store arbitrary JSON values that can vary per environment. Unlike feature flags, configs don’t have targeting rules — they’re simple key-value pairs with optional environment-specific overrides.

Creating a config

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "payment_providers",
"value": {
"stripe_public_key": "pk_test_123",
"paypal_enabled": true,
"apple_pay_enabled": false
}
}' \
"https://edgeflags.net/api/v1/configs"

Config keys must match the pattern [a-z0-9][a-z0-9._-]{0,127}.

Required fields

FieldTypeDescription
keystringUnique identifier
valueanyJSON value (string, number, boolean, object, or array)

Optional fields

FieldTypeDescription
environmentsobjectPer-environment value overrides

Reading a config

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/configs/payment_providers"

Response:

{
"value": {
"stripe_public_key": "pk_test_123",
"paypal_enabled": true,
"apple_pay_enabled": false
}
}

Environment overrides

Store different config values per environment:

Terminal window
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "api_limits",
"value": { "requests_per_minute": 1000 },
"environments": {
"production": { "value": { "requests_per_minute": 5000 } }
}
}' \
"https://edgeflags.net/api/v1/configs"

Setting an environment override

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "value": { "requests_per_minute": 10000 } }' \
"https://edgeflags.net/api/v1/configs/api_limits/environments/production"

Removing an environment override

Terminal window
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/configs/api_limits/environments/production"

Updating a config

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "value": { "requests_per_minute": 2000 } }' \
"https://edgeflags.net/api/v1/configs/api_limits"

Supports optimistic concurrency with If-Match:

Terminal window
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "If-Match: \"1\"" \
-d '{ "value": { "requests_per_minute": 2000 } }' \
"https://edgeflags.net/api/v1/configs/api_limits"

Deleting a config

Terminal window
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/configs/api_limits"

Listing configs

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/configs?limit=50&offset=0"

Response:

{
"configs": [
{
"key": "payment_providers",
"config": {
"value": { "stripe_public_key": "pk_test_123" },
"version": 1
}
}
],
"total": 1,
"has_more": false
}