Use this endpoint to create a new file or overwrite an existing one in your application’s filesystem. Provide the desired destination path and the file content as a string. If the file at the given path already exists it will be replaced; if the path does not exist the file will be created, including any necessary intermediate directories.
Endpoint
PUT https://api.virtuscloud.app/v2/apps/{app_id}/files
Authorization
Include your API key in the request header:
Path Parameters
The unique identifier of your application. You can find this in the URL of your application’s dashboard.
Body Parameters
The destination path for the file, relative to the root of your application. Example: /config/settings.json or /test.txt.
The text content to write to the file. For binary files, encode the content as a Base64 string before sending.
Response
Indicates the outcome of the request. Returns "success" when the file has been written successfully.
Examples
curl --request PUT \
--url "https://api.virtuscloud.app/v2/apps/{app_id}/files" \
--header "Authorization: <api_key>" \
--header "Content-Type: application/json" \
--data '{
"path": "/test.txt",
"content": "Hello from Virtus Cloud!"
}'
Response Example
If a file already exists at the specified path, this operation will overwrite it without any confirmation. Make sure you intend to replace the file before calling this endpoint.