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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Environment name (e.g., "test", "production") |
description | string | No | Description of the environment |
tier | string | Yes | Environment tier (e.g., "development", "staging", "production") |
region | string | Yes | Cloud region (e.g., "aws-stockholm") |
resourceQuota.cpu | string | Yes | CPU quota (e.g., "1000m" for 1 CPU core) |
resourceQuota.memory | string | Yes | Memory quota (e.g., "512MB") |
resourceQuota.bandwidthIn | string | No | Inbound bandwidth (e.g., "10MBps") |
resourceQuota.bandwidthOut | string | No | Outbound bandwidth (e.g., "1MBps") |
resourceQuota.filesystemStorage | string | No | Filesystem storage (e.g., "5GB") |
resourceQuota.persistentVolumes.storage | string | No | Persistent volume storage (e.g., "10GB") |
restoreFrom | string | No | Source 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 Code | Description |
|---|---|
| 400 | Bad Request - Invalid configuration or insufficient company quota |
| 401 | Unauthorized - Invalid or missing authentication |
| 403 | Forbidden - Insufficient permissions or resource quota exceeded |
| 500 | Internal 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"
}
}'