Environments

Environments

Manage environments within FlagForge projects

Overview

An environment is a deployment target within a FlagForge project, such as production. Use this resource to create environments under a project and list the environments that belong to it.

Environment operations are scoped to a project through the projectId path parameter. Environment keys are unique within each project, so the same key cannot be created twice for one project.

Creating an environment returns the created resource with HTTP 201. Listing environments returns an object containing a data array. The API declares a 404 error response when the referenced project is not found and a 409 error response when creating an environment conflicts with an existing key.

Schema

The create request accepts key and name. Environment responses include those fields together with the environment identifier, owning project identifier, and creation timestamp.

FieldTypeRequiredDescription
keystringYesEnvironment key, such as production.
namestringYesEnvironment name. Must contain at least one character and no more than 120 characters.
idstringYes in responsesEnvironment identifier.
projectIdstringYes in responsesIdentifier of the project that owns the environment.
createdAtstringYes in responsesEnvironment creation timestamp.

Endpoints

MethodPathDescription
POST/v1/projects/{projectId}/environmentsCreate an environment under a project. Environment keys must be unique within that project.
GET/v1/projects/{projectId}/environmentsList the environments for a project.