Upload Files to Application
curl --request POST \
--url https://api.vertracloud.app/v1/apps/{id}/files/upload \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.vertracloud.app/v1/apps/{id}/files/upload"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.vertracloud.app/v1/apps/{id}/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/apps/{id}/files/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/apps/{id}/files/upload"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/apps/{id}/files/upload")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/{id}/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"response": {}
}
File Manager
Upload Files to Application
Uploads a single file or a ZIP archive to an application. Optionally restarts the app after upload.
POST
/
v1
/
apps
/
{id}
/
files
/
upload
Upload Files to Application
curl --request POST \
--url https://api.vertracloud.app/v1/apps/{id}/files/upload \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.vertracloud.app/v1/apps/{id}/files/upload"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.vertracloud.app/v1/apps/{id}/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/apps/{id}/files/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/apps/{id}/files/upload"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/apps/{id}/files/upload")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/{id}/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"response": {}
}
string
required
The ID of the application to upload files to. If the application belongs to a workspace, pass its ID in the
workspace_id query parameter.string
If set to
"true", the application will automatically restart after the upload completes.string
If the application belongs to a workspace, the workspace’s ID. Members with an Owner, Admin or Developer role can use the file manager on a workspace app they don’t own; without this, only the app’s own owner can.
file
required
The file to upload — either a single loose file (written at its target path as-is) or a ZIP archive.A ZIP is extracted on top of the application’s existing volume: files it contains overwrite the matching paths, but files already on disk that aren’t in the ZIP are left untouched — it’s a merge, not a replace. Forbidden directories (
node_modules, .git, .local, and similar) are stripped from the ZIP on the server before extraction, regardless of what the archive contains.Multipart upload is capped at 100 MB; a ZIP is also capped at 512 MB once decompressed.Response
object
The result returned by the host after the upload.
{
"response": {}
}
Error Responses
string
The error code indicating the reason for failure. Possible values:
UNAUTHORIZED: The user is not authenticated.ACCESS_DENIED: The user does not have access to the application.APP_NOT_FOUND: The specified application does not exist.NO_FILE_UPLOADED: No file was provided in the request (400).INVALID_ZIP_STRUCTURE: The zip could not be read (400).UNKNOWN_ERROR: An unexpected platform error occurred.INTERNAL_SERVER_ERROR: An unexpected server error occurred.
{
"code": "UNAUTHORIZED"
}
{
"code": "ACCESS_DENIED"
}
{
"code": "APP_NOT_FOUND"
}
{
"code": "NO_FILE_UPLOADED"
}