/v1/workspaces/{workspace_id}/projects/{project_id}/environments/{environment_id}AuthUpdate an environment
Name, color, order, `protected` and `require_note`; the key never changes. Changing `protected` or `require_note` is recorded in the workspace audit log. Needs `flags.project.manage`.
Path parameters
environment_id*string · uuidId of the environment.
project_id*string · uuidId of the project.
workspace_id*string · uuidId of the workspace.
Request body
namestringDisplay name, 1-100 characters.
Example: "Staging"
colorstringDisplay color, `#rrggbb`.
Example: "#e67700"
ordinalintegerSort position.
Example: 1
protectedbooleanProtect the environment (or lift the protection).
require_notebooleanRequire a `note` on value changes.
notestringA change note (at most 500 characters), saved on the history entry. Environments with `require_note` refuse value writes without one.
Example: "Ticket FLAG-142"
Response · 200 The updated environment.
id*string · uuidThe environment's id.
workspace_id*string · uuidThe workspace that owns the environment.
project_id*string · uuidThe project the environment belongs to.
key*stringStable key, unique in the project. Cannot change.
Example: "production"
name*stringDisplay name.
Example: "Production"
color*stringDisplay color, `#rrggbb`.
Example: "#c92a2a"
ordinal*integerSort position in the project (ascending).
Example: 1
protected*booleanProtected environments need `flags.protected.update` (owners and admins by default) for any value change, on top of `flags.value.update`.
Example: true
require_note*booleanValue changes in this environment must carry a `note`.
Example: false
created_at*string · date-timeWhen the environment was created.
updated_at*string · date-timeWhen the environment last changed.
Example
Request
PATCH https://api.flags.productcraft.co/v1/workspaces/{workspace_id}/projects/{project_id}/environments/{environment_id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"name": "Staging",
"color": "#e67700",
"ordinal": 1,
"protected": false,
"require_note": false,
"note": "Ticket FLAG-142"
}Response
{
"id": "00000000-0000-0000-0000-000000000000",
"workspace_id": "00000000-0000-0000-0000-000000000000",
"project_id": "00000000-0000-0000-0000-000000000000",
"key": "production",
"name": "Production",
"color": "#c92a2a",
"ordinal": 1,
"protected": true,
"require_note": false,
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}