curl --request PUT \
--url https://api.cool.computer/api/computers/{id}/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-tar' \
--data '"<string>"'import requests
url = "https://api.cool.computer/api/computers/{id}/files/upload"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-tar"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/x-tar'},
body: JSON.stringify('<string>')
};
fetch('https://api.cool.computer/api/computers/{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.cool.computer/api/computers/{id}/files/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-tar"
],
]);
$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.cool.computer/api/computers/{id}/files/upload"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-tar")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cool.computer/api/computers/{id}/files/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-tar")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-tar'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "<string>",
"files": 1,
"dirs": 1,
"bytes": 1
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Upload a file tree
Extracts a tar archive beneath one destination directory on the persistent disk, creating the destination as needed. The archive accepts at most 10,000 entries, 64 MiB per file, and 512 MiB in aggregate. On a published site with no VM, its regular files, 64 MiB in all, are published as a new release under /home/runtime/app instead, never creating a VM.
curl --request PUT \
--url https://api.cool.computer/api/computers/{id}/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-tar' \
--data '"<string>"'import requests
url = "https://api.cool.computer/api/computers/{id}/files/upload"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-tar"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/x-tar'},
body: JSON.stringify('<string>')
};
fetch('https://api.cool.computer/api/computers/{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.cool.computer/api/computers/{id}/files/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-tar"
],
]);
$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.cool.computer/api/computers/{id}/files/upload"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-tar")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cool.computer/api/computers/{id}/files/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-tar")
.body("\"<string>\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-tar'
request.body = "\"<string>\""
response = http.request(request)
puts response.read_body{
"path": "<string>",
"files": 1,
"dirs": 1,
"bytes": 1
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Authorizations
A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.
Path Parameters
Stable public computer identifier.
1"cmp_123"
Query Parameters
Path inside the computer. A relative path is relative to /home/runtime, or to /home/runtime/app on a published site without a Linux computer.
1"/home/runtime/app.txt"
Body
The body is of type file.

