Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Create an environment

Creates an environment in a project, on one of the organization’s clusters.

POST/project/{project_id}/environment
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT token passed in the Authorization header using the Bearer <token> format.

Path parameters
project_iduuidrequired

The unique identifier for the project

Request body
requiredapplication/json
cluster_iduuidrequired

A universally unique identifier (UUID) string

namestringrequired

The name of the environment.

min length 1 · matches \S
typeenvironment_typerequired

The type of the environment.

Allowed:developmentstagingproduction
Responses
200

Environment created successfully

iduuidrequired

A universally unique identifier (UUID) string

organization_iduuidrequired

A universally unique identifier (UUID) string

project_iduuidrequired

A universally unique identifier (UUID) string

cluster_iduuidrequired

A universally unique identifier (UUID) string

namestringrequired

The name of the environment.

typeenvironment_typerequired

The type of the environment.

Allowed:developmentstagingproduction
created_atstring<date-time>required

The timestamp when the environment was created.

updated_atstring<date-time>required

The timestamp when the environment was last updated.

deleted_atstring<date-time> | nullrequired

The timestamp when the environment was deleted.

default

Error

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

Request
curl -X POST 'https://api.kapten.io/project/497f6eca-6276-4993-bfeb-53cbbbba6f08/environment' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "cluster_id": "d3d1bfdf-67c4-41fa-b065-858242731616",
  "name": "string",
  "type": "development"
}'
Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
  "cluster_id": "d3d1bfdf-67c4-41fa-b065-858242731616",
  "name": "string",
  "type": "development",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "deleted_at": "2019-08-24T14:15:22Z"
}

Was this page helpful?