Finalize a release
curl --request POST \
--url https://api.cool.computer/api/computers/{id}/releases/{number}/finalize \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cool.computer/api/computers/{id}/releases/{number}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cool.computer/api/computers/{id}/releases/{number}/finalize', 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}/releases/{number}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/computers/{id}/releases/{number}/finalize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.cool.computer/api/computers/{id}/releases/{number}/finalize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/releases/{number}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"release": {
"number": 2,
"state": "uploading",
"live": true,
"files": 1,
"bytes": 1,
"created_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z"
},
"url": "<string>",
"vm": true,
"next": {
"action": "upload",
"upload": {
"method": "PUT",
"href": "<string>"
},
"finalize": {
"method": "PUT",
"href": "<string>"
}
},
"release_url": "<string>"
}{
"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": {}
}{
"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": {}
}Publishing
Finalize a release
Makes a fully uploaded release live. A computer without a VM serves it from its own release hostname r<n>--<slug> and its URL. A computer its VM serves takes every release there: a release of files is written into /home/runtime/app (executables with mode 0755), which the VM's built-in site server serves at once, functions included. A release whose cool.json declares run gives the computer its VM if it has none, writes the files to it, starts the server and checks it, then hands it the URL. The receipt then reports vm true and has no release_url. Repeating finalize returns the same receipt.
POST
/
api
/
computers
/
{id}
/
releases
/
{number}
/
finalize
Finalize a release
curl --request POST \
--url https://api.cool.computer/api/computers/{id}/releases/{number}/finalize \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cool.computer/api/computers/{id}/releases/{number}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cool.computer/api/computers/{id}/releases/{number}/finalize', 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}/releases/{number}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cool.computer/api/computers/{id}/releases/{number}/finalize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.cool.computer/api/computers/{id}/releases/{number}/finalize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/releases/{number}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"release": {
"number": 2,
"state": "uploading",
"live": true,
"files": 1,
"bytes": 1,
"created_at": "2023-11-07T05:31:56Z",
"ready_at": "2023-11-07T05:31:56Z"
},
"url": "<string>",
"vm": true,
"next": {
"action": "upload",
"upload": {
"method": "PUT",
"href": "<string>"
},
"finalize": {
"method": "PUT",
"href": "<string>"
}
},
"release_url": "<string>"
}{
"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": {}
}{
"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.
Minimum string length:
1Example:
"cmp_123"
Release number, starting at 1 for each computer.
Required range:
x >= 1Response
The receipt of the live release.
Show child attributes
Show child attributes
The computer's URL, which serves the live release.
Whether the computer's VM serves its URL, because a server on it answered.
What to do next: upload the missing hashes, finalize, or nothing (done).
Show child attributes
Show child attributes
This release's own hostname r--. Absent once the computer's VM serves its URL.

