Skip to content
Skip to Content

Create an environment

POST
/projects/{projectId}/environments

An environment beside production, such as staging, with its own services, variables and private network on each server, so its services may share names with production's. Project admins only.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

projectId*string

The project's id.

Header parameters

Idempotency-Key?string

Any unique string up to 255 characters. Sending the same request again with it returns the first answer instead of creating twice.

Lengthlength <= 255

Request body

application/json
  1. body
name*string

Up to 32 lowercase letters, digits and hyphens, such as staging. Once per project.

Lengthlength <= 32

Response body

Create an environment

application/json
  1. response
id*string
Formatuuid
name*string
production*boolean
Example request
curl -X POST "https://openpanel.sh/api/v1/projects/$PROJECT_ID/environments" \  -H "Authorization: Bearer $OPENPANEL_TOKEN" \  -H "Content-Type: application/json" \  -d '{  "name": "string"}'
Example response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "production": true}