Skip to main content

Files API

Files allow you to inject configuration files, scripts, or other text content into your applications at specific mount paths.

Available Endpoints

MethodEndpointDescription
POST/{envId}/fileCreate a new file
GET/{envId}/file/{id}Get file details
GET/{envId}/fileList all files in environment
PUT/{envId}/file/{id}Update file content or path
DELETE/{envId}/file/{id}Delete a file
POST/{envId}/file/validateValidate file configuration

File Object

{
"id": "file-550e8400-e29b-41d4-a716-446655440000",
"name": "config.json",
"envIdRef": "660e8400-e29b-41d4-a716-446655440001",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"content": "{\"database\": \"postgres://localhost:5432/db\"}",
"mountPath": "/app/config",
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-123",
"version": 1
}

Quick Example

# Create a configuration file
curl -X POST "https://api.thevenin.cloud/environments/$ENV_ID/file" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "app-config.json",
"content": "{\"port\": 8080, \"debug\": true}",
"mountPath": "/app/config"
}'

# List all files
curl -X GET "https://api.thevenin.cloud/environments/$ENV_ID/file" \
-H "Authorization: Bearer $API_TOKEN"

# Delete file
curl -X DELETE "https://api.thevenin.cloud/environments/$ENV_ID/file/$FILE_ID" \
-H "Authorization: Bearer $API_TOKEN"

Common Use Cases

  • Configuration Files: Application config files (JSON, YAML, XML)
  • Scripts: Initialization or startup scripts
  • Certificates: SSL certificates or keys
  • Templates: Email or HTML templates
  • Static Content: Small static files needed by applications

Notes

  • Files are stored as text content in the database
  • Maximum file size may be limited by your plan
  • Files are injected at container startup
  • Multiple applications can use the same file
  • Changes require application restart to take effect