Skip to main content

Update File

Update a configuration file's name, content, or mount path.

Endpoint

PUT /{envId}/file/{id}

Authentication

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

Path Parameters

ParameterTypeRequiredDescription
envIdstring (UUID)YesEnvironment ID containing the file
idstring (UUID)YesFile ID to update

Request Body

{
"name": "app-config-updated.json",
"envIdRef": "your-environment-id",
"fileString": "{\"port\": 9000, \"debug\": false}",
"mountPath": "/app/config",
"attachedAppsRefs": []
}

Request Fields

FieldTypeRequiredDescription
namestringYesFile name
envIdRefstringYesEnvironment ID (UUID)
fileStringstringYesFile content as string
mountPathstringYesAbsolute path where file will be mounted
attachedAppsRefsarrayNoArray of application IDs to attach file to

Response

Success Response (200 OK)

{
"id": "file-550e8400-e29b-41d4-a716-446655440000",
"name": "app-config-updated.json",
"envIdRef": "660e8400-e29b-41d4-a716-446655440001",
"companyIdRef": "770e8400-e29b-41d4-a716-446655440002",
"content": "{\"port\": 9000, \"debug\": false, \"apiUrl\": \"https://api.production.com\"}",
"mountPath": "/app/config",
"isDeleted": false,
"createdBy": "user-123",
"modifiedBy": "user-456",
"version": 3
}

Error Responses

Status CodeDescription
400Bad Request - Invalid configuration
401Unauthorized - Invalid or missing authentication
403Forbidden - User doesn't have access to this file
404Not Found - File or environment doesn't exist
500Internal Server Error

Example

curl -X PUT "https://api.thevenin.cloud/environments/{envId}/file/{fileId}" \
-H "Authorization: Bearer tvn_your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"name": "app-config-updated.json",
"envIdRef": "{envId}",
"fileString": "{\"port\": 9000}",
"mountPath": "/app/config",
"attachedAppsRefs": []
}'

Notes

  • This is a PUT request requiring all fields
  • Changes require application restart to take effect
  • Use attachedAppsRefs to attach/detach the file from applications