Skip to content

Projects & Environments

Projects provide multi-tenant isolation — each project has its own flags, configs, segments, and audit trail. Environments let you vary flag behavior across development, staging, and production.

Projects

API tokens are scoped to a project. When you authenticate, the project ID from your token determines which flags and configs you can access.

Viewing project settings

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

Response:

{
"id": "default",
"name": "Default Project",
"slug": "default",
"environments": ["development", "staging", "production"]
}

Updating project name

Terminal window
curl -X PUT \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "My App" }' \
"https://edgeflags.net/api/v1/project"

Environments

Every project starts with three default environments: development, staging, and production. You can add custom environments for your workflow.

Listing environments

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

Response:

{
"environments": ["development", "staging", "production"]
}

Adding an environment

Terminal window
curl -X POST \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "canary" }' \
"https://edgeflags.net/api/v1/project/environments"

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

Removing an environment

Terminal window
curl -X DELETE \
-H "Authorization: Bearer $ADMIN_TOKEN" \
"https://edgeflags.net/api/v1/project/environments/canary"

You cannot remove the last remaining environment.

Using environments with flags

Environments affect flag evaluation through two mechanisms:

1. Environment overrides on flags

Flags can have per-environment overrides for enabled, value, and targeting. See Feature Flags — Environment Overrides.

2. Context environment

When evaluating flags, include the environment field in the context:

Terminal window
curl -H "Authorization: Bearer $TOKEN" \
"https://edgeflags.net/api/v1/flags/new_checkout?context=%7B%22environment%22%3A%22production%22%7D"

Or in bulk evaluation:

{
"context": {
"user_id": "u_123",
"environment": "production"
},
"flags": ["new_checkout"]
}

If the flag has an override for the specified environment, that override takes priority over the base flag configuration.

Using environments with configs

Configs support environment-specific values. When using bulk evaluation with context.environment, the config value for that environment is returned if available:

{
"context": {
"environment": "production"
},
"configs": ["payment_providers"]
}

You can also set environment overrides directly:

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