API
API: clientes e informes
Para agencias y hosting: liste clientes con su estado y obtenga automáticamente informes mensuales con su logotipo.
GET /customers
Listar clientes · Lectura
Clientes según la asignación de los servidores, con número de servidores, alertas críticas y altas abiertas y último aviso.
Ejemplo de llamada
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());Ejemplo de respuesta 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
Informe mensual de un cliente (PDF) · Lectura
El informe mensual en PDF, con el nombre y el logotipo de su agencia. Sin month, el mes en curso; 404 si el cliente no tiene servidores.
| Parámetro | Ubicación | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
name | ruta | string | sí | nombre del cliente (codificado para URL) |
month | query | YYYY-MM | no | mes, p. ej. 2026-10 |
Ejemplo de llamada
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()));Ejemplo de respuesta HTTP 200
Respuesta: un archivo PDF (Content-Type application/pdf).
Vea en dos minutos lo que ocurre en su servidor.
Instale el agente con un solo comando, espere al primer inventario y listo. 14 días gratis, hasta 3 servidores, sin tarjeta de crédito.