API
API: Kunden und Berichte
Für Agenturen und Hoster: Kunden mit Zustand auflisten und Monatsberichte mit Ihrem Logo automatisch abholen.
GET /customers
Kunden auflisten · Lesen
Kunden aus der Kunden-Zuordnung der Server, mit Anzahl Server, offenen kritischen und hohen Alarmen und letzter Meldung.
Beispielaufruf
cURL
curl -sSf "https://app.tyrosec.com/api/v1/customers" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-H "Accept: application/json"Python
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/customers",
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/customers');
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/customers", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());Beispiel-Antwort HTTP 200
{
"data": [
{
"name": "Beispiel-Shop GmbH",
"servers": 2,
"open_alerts": {
"critical": 4,
"high": 4
},
"last_seen": "2026-11-18T15:27:47+00:00"
},
{
"name": "Kanzlei Muster",
"servers": 1,
"open_alerts": {
"critical": 2,
"high": 1
},
"last_seen": "2026-11-18T15:27:47+00:00"
}
]
}GET /customers/{name}/report.pdf
Monatsbericht eines Kunden (PDF) · Lesen
Der Monatsbericht als PDF, mit Name und Logo Ihrer Agentur. Ohne month der laufende Monat; 404, wenn der Kunde keine Server hat.
| Parameter | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
name | Pfad | string | ja | Kundenname (URL-kodiert) |
month | Query | YYYY-MM | nein | Monat, z. B. 2026-10 |
Beispielaufruf
cURL
curl -sSf "https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10" \
-H "Authorization: Bearer $TYROSEC_TOKEN" \
-o report.pdfPython
import os
import requests
resp = requests.request(
"GET",
"https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf",
headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
params={"month": "2026-10"},
timeout=30,
)
resp.raise_for_status()
with open("report.pdf", "wb") as f:
f.write(resp.content)PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10');
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)); }
file_put_contents('report.pdf', $out);JavaScript
import { writeFile } from "node:fs/promises";
const res = await fetch("https://app.tyrosec.com/api/v1/customers/Beispiel-Shop%20GmbH/report.pdf?month=2026-10", {
headers: {
Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
await writeFile("report.pdf", Buffer.from(await res.arrayBuffer()));Beispiel-Antwort HTTP 200
Antwort: PDF-Datei (Content-Type application/pdf).
In zwei Minuten sehen, was auf Ihrem Server passiert.
Agent per Einzeiler installieren, Erst-Erfassung abwarten, fertig. 14 Tage kostenlos, bis zu 3 Server, ohne Kreditkarte.