Worker Heartbeat Simple
curl --request POST \
--url https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active",
"tasks_processed": 0,
"current_task_id": "<string>",
"worker_metadata": {},
"system_info": {
"hostname": "<string>",
"platform": "<string>",
"os_name": "<string>",
"os_version": "<string>",
"python_version": "<string>",
"cli_version": "<string>",
"sdk_version": "<string>",
"pid": 123,
"cwd": "<string>",
"supported_runtimes": [
"<string>"
],
"llm_gateway_url": "<string>",
"docker_available": true,
"docker_version": "<string>",
"cpu_count": 123,
"cpu_percent": 123,
"memory_total": 123,
"memory_used": 123,
"memory_percent": 123,
"disk_total": 123,
"disk_used": 123,
"disk_percent": 123,
"uptime_seconds": 123
},
"logs": [
"<string>"
]
}
'import requests
url = "https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat"
payload = {
"status": "active",
"tasks_processed": 0,
"current_task_id": "<string>",
"worker_metadata": {},
"system_info": {
"hostname": "<string>",
"platform": "<string>",
"os_name": "<string>",
"os_version": "<string>",
"python_version": "<string>",
"cli_version": "<string>",
"sdk_version": "<string>",
"pid": 123,
"cwd": "<string>",
"supported_runtimes": ["<string>"],
"llm_gateway_url": "<string>",
"docker_available": True,
"docker_version": "<string>",
"cpu_count": 123,
"cpu_percent": 123,
"memory_total": 123,
"memory_used": 123,
"memory_percent": 123,
"disk_total": 123,
"disk_used": 123,
"disk_percent": 123,
"uptime_seconds": 123
},
"logs": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'active',
tasks_processed: 0,
current_task_id: '<string>',
worker_metadata: {},
system_info: {
hostname: '<string>',
platform: '<string>',
os_name: '<string>',
os_version: '<string>',
python_version: '<string>',
cli_version: '<string>',
sdk_version: '<string>',
pid: 123,
cwd: '<string>',
supported_runtimes: ['<string>'],
llm_gateway_url: '<string>',
docker_available: true,
docker_version: '<string>',
cpu_count: 123,
cpu_percent: 123,
memory_total: 123,
memory_used: 123,
memory_percent: 123,
disk_total: 123,
disk_used: 123,
disk_percent: 123,
uptime_seconds: 123
},
logs: ['<string>']
})
};
fetch('https://control-plane.kubiya.ai/api/v1/workers/{worker_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://control-plane.kubiya.ai/api/v1/workers/{worker_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([
'status' => 'active',
'tasks_processed' => 0,
'current_task_id' => '<string>',
'worker_metadata' => [
],
'system_info' => [
'hostname' => '<string>',
'platform' => '<string>',
'os_name' => '<string>',
'os_version' => '<string>',
'python_version' => '<string>',
'cli_version' => '<string>',
'sdk_version' => '<string>',
'pid' => 123,
'cwd' => '<string>',
'supported_runtimes' => [
'<string>'
],
'llm_gateway_url' => '<string>',
'docker_available' => true,
'docker_version' => '<string>',
'cpu_count' => 123,
'cpu_percent' => 123,
'memory_total' => 123,
'memory_used' => 123,
'memory_percent' => 123,
'disk_total' => 123,
'disk_used' => 123,
'disk_percent' => 123,
'uptime_seconds' => 123
],
'logs' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat"
payload := strings.NewReader("{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Worker Heartbeat Simple
Receive heartbeat from a worker (simplified version with worker_id in URL).
OPTIMIZATION: Uses Redis for scalable heartbeat storage instead of database. Database writes are expensive and heartbeats happen every 30s per worker. Redis provides sub-millisecond writes and automatic TTL expiration.
Args: worker_id: Worker ID (UUID) heartbeat: Heartbeat data
POST
/
api
/
v1
/
workers
/
{worker_id}
/
heartbeat
Worker Heartbeat Simple
curl --request POST \
--url https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active",
"tasks_processed": 0,
"current_task_id": "<string>",
"worker_metadata": {},
"system_info": {
"hostname": "<string>",
"platform": "<string>",
"os_name": "<string>",
"os_version": "<string>",
"python_version": "<string>",
"cli_version": "<string>",
"sdk_version": "<string>",
"pid": 123,
"cwd": "<string>",
"supported_runtimes": [
"<string>"
],
"llm_gateway_url": "<string>",
"docker_available": true,
"docker_version": "<string>",
"cpu_count": 123,
"cpu_percent": 123,
"memory_total": 123,
"memory_used": 123,
"memory_percent": 123,
"disk_total": 123,
"disk_used": 123,
"disk_percent": 123,
"uptime_seconds": 123
},
"logs": [
"<string>"
]
}
'import requests
url = "https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat"
payload = {
"status": "active",
"tasks_processed": 0,
"current_task_id": "<string>",
"worker_metadata": {},
"system_info": {
"hostname": "<string>",
"platform": "<string>",
"os_name": "<string>",
"os_version": "<string>",
"python_version": "<string>",
"cli_version": "<string>",
"sdk_version": "<string>",
"pid": 123,
"cwd": "<string>",
"supported_runtimes": ["<string>"],
"llm_gateway_url": "<string>",
"docker_available": True,
"docker_version": "<string>",
"cpu_count": 123,
"cpu_percent": 123,
"memory_total": 123,
"memory_used": 123,
"memory_percent": 123,
"disk_total": 123,
"disk_used": 123,
"disk_percent": 123,
"uptime_seconds": 123
},
"logs": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'active',
tasks_processed: 0,
current_task_id: '<string>',
worker_metadata: {},
system_info: {
hostname: '<string>',
platform: '<string>',
os_name: '<string>',
os_version: '<string>',
python_version: '<string>',
cli_version: '<string>',
sdk_version: '<string>',
pid: 123,
cwd: '<string>',
supported_runtimes: ['<string>'],
llm_gateway_url: '<string>',
docker_available: true,
docker_version: '<string>',
cpu_count: 123,
cpu_percent: 123,
memory_total: 123,
memory_used: 123,
memory_percent: 123,
disk_total: 123,
disk_used: 123,
disk_percent: 123,
uptime_seconds: 123
},
logs: ['<string>']
})
};
fetch('https://control-plane.kubiya.ai/api/v1/workers/{worker_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://control-plane.kubiya.ai/api/v1/workers/{worker_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([
'status' => 'active',
'tasks_processed' => 0,
'current_task_id' => '<string>',
'worker_metadata' => [
],
'system_info' => [
'hostname' => '<string>',
'platform' => '<string>',
'os_name' => '<string>',
'os_version' => '<string>',
'python_version' => '<string>',
'cli_version' => '<string>',
'sdk_version' => '<string>',
'pid' => 123,
'cwd' => '<string>',
'supported_runtimes' => [
'<string>'
],
'llm_gateway_url' => '<string>',
'docker_available' => true,
'docker_version' => '<string>',
'cpu_count' => 123,
'cpu_percent' => 123,
'memory_total' => 123,
'memory_used' => 123,
'memory_percent' => 123,
'disk_total' => 123,
'disk_used' => 123,
'disk_percent' => 123,
'uptime_seconds' => 123
],
'logs' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat"
payload := strings.NewReader("{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control-plane.kubiya.ai/api/v1/workers/{worker_id}/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"active\",\n \"tasks_processed\": 0,\n \"current_task_id\": \"<string>\",\n \"worker_metadata\": {},\n \"system_info\": {\n \"hostname\": \"<string>\",\n \"platform\": \"<string>\",\n \"os_name\": \"<string>\",\n \"os_version\": \"<string>\",\n \"python_version\": \"<string>\",\n \"cli_version\": \"<string>\",\n \"sdk_version\": \"<string>\",\n \"pid\": 123,\n \"cwd\": \"<string>\",\n \"supported_runtimes\": [\n \"<string>\"\n ],\n \"llm_gateway_url\": \"<string>\",\n \"docker_available\": true,\n \"docker_version\": \"<string>\",\n \"cpu_count\": 123,\n \"cpu_percent\": 123,\n \"memory_total\": 123,\n \"memory_used\": 123,\n \"memory_percent\": 123,\n \"disk_total\": 123,\n \"disk_used\": 123,\n \"disk_percent\": 123,\n \"uptime_seconds\": 123\n },\n \"logs\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Enter your Kubiya API token (format: Bearer )
Path Parameters
Body
application/json
Response
Successful Response
Was this page helpful?
⌘I