Home / Resources / API Reference

Environment

Base route: /api/environment

Create environment

This API endpoint creates a new environment within a specific workspace. Environments are used to group infrastructure targets for deployments.

Request

Parameters
workspaceId
string
required
The unique identifier of the workspace where the environment will be created.
name
string
required
The name of the environment (e.g., Production, Staging).
sortOrder
number
optional
Defines the display order of the environment in the user interface.
color
string
optional
The color associated with this environment for visual identification.
Request body

POST /api/environment {   "workspaceId": "string",   "name": "string",   "sortOrder": 0,   "color": "string" }

Response

Parameters
environmentId
string
The unique ID of the created environment, used for future updates or deletions.
Response body

{   "environmentId": "string" }