Host Heartbeat
curl --request POST \
--url https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat \
--header 'Content-Type: application/json' \
--data '
{
"busy": true,
"storage_bytes": 4611686018427388000,
"busy_reason": "<string>",
"next_wake_at": "2023-11-07T05:31:56Z",
"connection": {
"computer_id": "<string>",
"url": "<string>",
"public_key": "<string>"
}
}
'import requests
url = "https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat"
payload = {
"busy": True,
"storage_bytes": 4611686018427388000,
"busy_reason": "<string>",
"next_wake_at": "2023-11-07T05:31:56Z",
"connection": {
"computer_id": "<string>",
"url": "<string>",
"public_key": "<string>"
}
}
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({
busy: true,
storage_bytes: 4611686018427388000,
busy_reason: '<string>',
next_wake_at: '2023-11-07T05:31:56Z',
connection: {computer_id: '<string>', url: '<string>', public_key: '<string>'}
})
};
fetch('https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat', 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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat",
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([
'busy' => true,
'storage_bytes' => 4611686018427388000,
'busy_reason' => '<string>',
'next_wake_at' => '2023-11-07T05:31:56Z',
'connection' => [
'computer_id' => '<string>',
'url' => '<string>',
'public_key' => '<string>'
]
]),
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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat"
payload := strings.NewReader("{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}")
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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat")
.header("Content-Type", "application/json")
.body("{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat")
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 = "{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"accept_new_work": true,
"blocked_reason": "PLAN_REQUIRED",
"sleep_requested": true,
"lease_expires_at": "2023-11-07T05:31:56Z"
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}cloud-computers
Host Heartbeat
POST
/
cloud-computers
/
host
/
{computer_id}
/
heartbeat
Host Heartbeat
curl --request POST \
--url https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat \
--header 'Content-Type: application/json' \
--data '
{
"busy": true,
"storage_bytes": 4611686018427388000,
"busy_reason": "<string>",
"next_wake_at": "2023-11-07T05:31:56Z",
"connection": {
"computer_id": "<string>",
"url": "<string>",
"public_key": "<string>"
}
}
'import requests
url = "https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat"
payload = {
"busy": True,
"storage_bytes": 4611686018427388000,
"busy_reason": "<string>",
"next_wake_at": "2023-11-07T05:31:56Z",
"connection": {
"computer_id": "<string>",
"url": "<string>",
"public_key": "<string>"
}
}
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({
busy: true,
storage_bytes: 4611686018427388000,
busy_reason: '<string>',
next_wake_at: '2023-11-07T05:31:56Z',
connection: {computer_id: '<string>', url: '<string>', public_key: '<string>'}
})
};
fetch('https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat', 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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat",
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([
'busy' => true,
'storage_bytes' => 4611686018427388000,
'busy_reason' => '<string>',
'next_wake_at' => '2023-11-07T05:31:56Z',
'connection' => [
'computer_id' => '<string>',
'url' => '<string>',
'public_key' => '<string>'
]
]),
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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat"
payload := strings.NewReader("{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}")
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.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat")
.header("Content-Type", "application/json")
.body("{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moda.app/v1/cloud-computers/host/{computer_id}/heartbeat")
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 = "{\n \"busy\": true,\n \"storage_bytes\": 4611686018427388000,\n \"busy_reason\": \"<string>\",\n \"next_wake_at\": \"2023-11-07T05:31:56Z\",\n \"connection\": {\n \"computer_id\": \"<string>\",\n \"url\": \"<string>\",\n \"public_key\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"accept_new_work": true,
"blocked_reason": "PLAN_REQUIRED",
"sleep_requested": true,
"lease_expires_at": "2023-11-07T05:31:56Z"
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}{
"type": "invalid_request",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"causes": [
"<unknown>"
],
"details": {},
"retry_after_ms": 123,
"retryable": true
}Headers
Calendar-dated API version pin. New integrations should pin 2026-05-01 to opt into the newest response shapes. For back-compat the server also accepts requests with no header and resolves them to the current default (today: 2026-04-12); that default advances on each sunset date. Any unsupported value returns 400 unsupported_version.
Available options:
2026-04-12, 2026-05-01 Example:
"2026-05-01"
Path Parameters
Body
application/json