POST/organizations/{organizationId}/projects/{projectId}/environments

Create a project environment

Creates an isolated environment with configurable variables and deployment protection.

Send request

Use the documented inputs to call this endpoint directly.

API serverbase URL
Bearer tokenBearerAuthoptional
Stored only in this browser for the BearerAuth security scheme and reused on every API page in this group.

Parameters

Values are applied to the request and the example on the right.

organizationIdpath · stringrequired

Opaque organization identifier.

projectIdpath · stringrequired

Request body

application/jsonrequired
namestringrequired
slugstringrequired
protectionenumoptional

Values: "none" · "approval_required" · "locked"

variablesobjectoptional

Responses

201application/json

Environment created.

{
  "id": "env_01J8F7M3Q9X5V2K6P4N",
  "name": "Staging",
  "slug": "staging",
  "protection": "approval_required",
  "variables_count": 12,
  "last_deployment_at": "2026-09-02T18:20:00Z"
}
idstringoptional
namestringoptional
slugstringoptional
protectionstringoptional
variables_countintegeroptional
last_deployment_atstring · date-timeoptional
422

Environment configuration is invalid.