v1

latestOpenAPI 3.0.02026-07-13103151174.7 KB
Environments

Update an Environment

Update an environment by ID or key. The environment key (if edited) must be unique within the project. If permissions are enabled, changing a protected environment type requires Publisher permissions

patch/v1/projects/{project}/environments/{key}

Path parameters

keystring required

A Environment key or ID

projectstring required

A Project key or ID

Request body

namestring

A unique display name

keystring

Unique Environment identifier, can be used in the SDK / API to reference by key rather than ID. Must only contain lower-case characters and _, - or ..

descriptionstring

Environment description.

colorstring

Environment display color, used to highlight different environments on the dashboard. Must use Hex color code.

type'development' | 'staging' | 'production' | 'disaster_recovery'

The environment type

Example request

{
  "name": "Staging Upcoming",
  "key": "staging-upcoming",
  "description": "Pre-production changes",
  "color": "#4073FF",
  "type": "staging"
}

Response

namestring required

A unique display name

keystring required

Unique Environment identifier, can be used in the SDK / API to reference by key rather than ID. Must only contain lower-case characters and _, - or ..

descriptionstring

Environment description.

colorstring

Environment display color, used to highlight different environments on the dashboard. Must use Hex color code.

_idstring required

A unique Environment ID

_projectstring required

The Project owning the Environment

type'development' | 'staging' | 'production' | 'disaster_recovery' required

The environment type

_createdBystring required

ID of the User who created the Environment.

createdAtstring date-time required

The date the Environment was created

updatedAtstring date-time required

The date the Environment was last updated

readonlyboolean required

Controls whether the environment is editable for a given user

Example response

{
  "name": "Staging Upcoming",
  "key": "staging-upcoming",
  "description": "Pre-production changes",
  "color": "#4073FF",
  "_id": "61450f3daec96f5cf4a49946",
  "type": "staging"
}