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.
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Environment key, such as production. |
name | string | Yes | Environment name. Must contain at least one character and no more than 120 characters. |
id | string | Yes in responses | Environment identifier. |
projectId | string | Yes in responses | Identifier of the project that owns the environment. |
createdAt | string | Yes in responses | Environment creation timestamp. |
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /v1/projects/{projectId}/environments | Create an environment under a project. Environment keys must be unique within that project. |
GET | /v1/projects/{projectId}/environments | List the environments for a project. |