Skip to main content

Create Environment

Create a new isolated environment for deploying applications and managing resources.

Endpoint

POST /environments

Authentication

Required: Yes (Session or Bearer Token with 2FA)

Request Body

{
"name": "test",
"description": "",
"tier": "development",
"region": "aws-stockholm",
"resourceQuota": {
"cpu": "1000m",
"memory": "512MB",
"bandwidthIn": "10MBps",
"bandwidthOut": "1MBps",
"filesystemStorage": "5GB",
"persistentVolumes": {
"storage": "10GB"
}
},
"restoreFrom": ""
}

Request Fields

FieldTypeRequiredDescription
namestringYesEnvironment name (e.g., "test", "production")
descriptionstringNoDescription of the environment
tierstringYesEnvironment tier (e.g., "development", "staging", "production")
regionstringYesCloud region (e.g., "aws-stockholm")
resourceQuota.cpustringYesCPU quota (e.g., "1000m" for 1 CPU core)
resourceQuota.memorystringYesMemory quota (e.g., "512MB")
resourceQuota.bandwidthInstringNoInbound bandwidth (e.g., "10MBps")
resourceQuota.bandwidthOutstringNoOutbound bandwidth (e.g., "1MBps")
resourceQuota.filesystemStoragestringNoFilesystem storage (e.g., "5GB")
resourceQuota.persistentVolumes.storagestringNoPersistent volume storage (e.g., "10GB")
restoreFromstringNoSource environment ID to restore from (if any)

Response

Success Response (201 Created)

{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "production",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"resourceQuota": {
"cpu": 10000,
"memory": 16384,
"storage": 102400
},
"resourceUsage": {
"cpu": 0,
"memory": 0,
"storage": 0
},
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-123",
"version": 1
}

Error Responses

Status CodeDescription
400Bad Request - Invalid configuration or insufficient company quota
401Unauthorized - Invalid or missing authentication
403Forbidden - Insufficient permissions or resource quota exceeded
500Internal Server Error

Example

curl -X POST "https://api.thevenin.cloud/environments" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "production",
"description": "",
"tier": "production",
"region": "aws-stockholm",
"resourceQuota": {
"cpu": "10000m",
"memory": "16GB",
"filesystemStorage": "100GB"
}
}'