API: servers
Query servers, assign clients, check websites and TLS certificates and read the automatic measures per server.
GET /hosts
List servers · Read
All servers of the account with status, client, operating system, agent version, security score (0–100, grade A–F) and open alerts per severity.
Example request
cURL
curl -sSf "https://app.tyrosec.com/api/v1/hosts" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json"Python
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/hosts",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Example response HTTP 200
{
"data": [
{
"id": "d470ea5e-5455-496f-86e1-d685a1c645a7",
"name": "api-04",
"hostname": "api-04",
"customer": "Beispiel-Shop GmbH",
"status": "silent",
"os": "Debian GNU/Linux 12 (bookworm)",
"agent_version": "0.4.6",
"last_seen": "2026-11-18T15:27:47+00:00",
"score": 90,
"grade": "A",
"open_alerts": {}
},
{
"id": "204aa573-2538-49b7-b4db-9dc2adc7a7d0",
"name": "cloud-03",
"hostname": "cloud-03",
"customer": "Praxis Sonnenschein",
"status": "silent",
"os": "Ubuntu 22.04.5 LTS",
"agent_version": "0.4.6",
"last_seen": "2026-11-18T15:27:47+00:00",
"score": 89,
"grade": "B",
"open_alerts": {
"info": 1,
"medium": 2
}
}
]
}GET /hosts/{id}
Get a server · Read
Same as in the list, for exactly one server.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | server ID (UUID) |
Example request
cURL
curl -sSf "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json"Python
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Example response HTTP 200
{
"data": {
"id": "7c1b6092-482b-48d9-b40f-fb476bd98176",
"name": "shop-01",
"hostname": "shop-01",
"customer": "Beispiel-Shop GmbH",
"status": "silent",
"os": "Ubuntu 24.04.1 LTS",
"agent_version": "0.4.6",
"last_seen": "2026-11-18T15:27:47+00:00",
"score": 20,
"grade": "F",
"open_alerts": {
"critical": 4,
"high": 4,
"low": 1
}
}
}PATCH /hosts/{id}
Assign a server to a client · Write
Sets a server’s client; null or an empty string removes it. Response: the server as with GET /hosts/{id}.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | server ID (UUID) |
customer | JSON body | string|null | yes | client name or null |
Example request
cURL
curl -sSf -X PATCH "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"customer": "Beispiel-Shop GmbH"}'Python
import os
import requests
resp = requests.request(
"PATCH",
"https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
json={"customer": "Beispiel-Shop GmbH"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode(['customer' => 'Beispiel-Shop GmbH']),
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json', 'Content-Type: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({"customer": "Beispiel-Shop GmbH"}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Example response HTTP 200
{
"data": {
"id": "7c1b6092-482b-48d9-b40f-fb476bd98176",
"name": "shop-01",
"hostname": "shop-01",
"customer": "Beispiel-Shop GmbH",
"status": "silent",
"os": "Ubuntu 24.04.1 LTS",
"agent_version": "0.4.6",
"last_seen": "2026-11-18T15:27:47+00:00",
"score": 20,
"grade": "F",
"open_alerts": {
"critical": 3,
"high": 4,
"low": 1
}
}
}GET /hosts/{id}/sites
Websites of a server · Read
Detected websites with HTTP status, response time and TLS certificate (expiry, issuer, validity, TLS version).
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | server ID (UUID) |
Example request
cURL
curl -sSf "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/sites" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json"Python
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/sites",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/sites');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/sites", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Example response HTTP 200
{
"data": [
{
"domain": "b2b.beispiel-shop.de",
"checked_at": "2026-11-18 15:19:12+00",
"http_status": 200,
"ms": 240,
"cert_expires": "2026-11-27 15:26:12+00",
"cert_issuer": "Let's Encrypt R11",
"cert_ok": true,
"tls_version": "TLSv1.3",
"error": null
}
]
}GET /hosts/{id}/measures
Automatic measures of a server · Read
Effective settings of the automatic measures (off, dry run, active) with parameters and origin (host, template or default). Read-only; meta.live shows whether automatic execution is enabled.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | uuid | yes | server ID (UUID) |
Example request
cURL
curl -sSf "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/measures" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json"Python
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/measures",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
timeout=30,
)
resp.raise_for_status()
print(resp.json())PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/measures');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/measures", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Example response HTTP 200
{
"data": [
{
"key": "ssh_bruteforce",
"group": "net",
"risk": "low",
"ready": true,
"manual": false,
"mode": "off",
"params": {
"threshold": 20,
"duration_h": 24
},
"source": "default"
},
{
"key": "web_bruteforce",
"group": "net",
"risk": "low",
"ready": true,
"manual": false,
"mode": "off",
"params": {
"threshold": 20,
"duration_h": 24
},
"source": "default"
}
],
"meta": {
"live": false
}
}See what’s happening on your server in two minutes.
Install the agent with a one-liner, wait for the initial scan, done. 14 days free, up to 3 servers, no credit card required.