Skip to main content

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

ParameterTypeRequiredDescription
envIdstring (UUID)YesEnvironment ID where volume will be created

Request Body

{
"name": "postgres-data",
"resourceRequests": {
"storage": "1GB"
},
"attachedAppsRefs": []
}

Request Fields

FieldTypeRequiredDescription
namestringYesVolume name (must be unique in environment)
resourceRequests.storagestringYesStorage size (e.g., "1GB", "10GB", "100MB")
attachedAppsRefsarrayNoArray 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 CodeDescription
400Bad Request - Invalid volume configuration or name already exists
401Unauthorized - Invalid or missing authentication
403Forbidden - User doesn't have access to the environment
404Not Found - Environment doesn't exist
500Internal 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