Create Volume
Create a new persistent storage volume in an environment.
Endpoint
POST /environments/{envId}/volume
Authentication
Required: Yes (Session or Bearer Token with 2FA)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
envId | string (UUID) | Yes | Environment ID where volume will be created |
Request Body
{
"name": "postgres-data",
"resourceRequests": {
"storage": "1GB"
},
"attachedAppsRefs": []
}
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Volume name (must be unique in environment) |
resourceRequests.storage | string | Yes | Storage size (e.g., "1GB", "10GB", "100MB") |
attachedAppsRefs | array | No | Array of application IDs to attach volume to |
Response
Success Response (201 Created)
{
"id": "vol-550e8400-e29b-41d4-a716-446655440000",
"name": "postgres-data",
"envIdRef": "660e8400-e29b-41d4-a716-446655440001",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"size": 10240,
"mountPath": "/var/lib/postgresql/data",
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-123",
"version": 1
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid volume configuration or name already exists |
| 401 | Unauthorized - Invalid or missing authentication |
| 403 | Forbidden - User doesn't have access to the environment |
| 404 | Not Found - Environment doesn't exist |
| 500 | Internal Server Error |
Examples
cURL
curl -X POST "https://api.thevenin.cloud/environments/{envId}/volume" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "postgres-data",
"resourceRequests": {
"storage": "10GB"
},
"attachedAppsRefs": []
}'
Notes
- Volume names must be unique within environment
- Size cannot be decreased after creation
- Data persists even if applications are deleted
- Multiple applications can mount the same volume