The tyrosec API
Use the REST API to connect tyrosec to your ticket system, dashboard, rollout scripts and CI/CD. Every endpoint with examples in cURL, Python, PHP and JavaScript – each example is tested.
At a glance
- Base URL
https://app.tyrosec.com/api/v1– responses in JSON, timestamps in ISO 8601 (UTC). - AuthenticationBearer token in the
Authorizationheader. Administrators create tokens under Settings › API, with read or write scope. - PlanThe API is part of the Agency plan – also during the free trial.
- Rate limit120 requests per minute; above that the API responds with HTTP 429.
- OpenAPIMachine-readable description: openapi.json – e.g. for Postman or code generators.
- Language of textsAlert titles and explanations are currently returned in German; fields such as
ruleandseverityare language-independent.
Getting started
- 01Create a tokenIn tyrosec under Settings › API: give it a name and choose read or write scope. The token is shown only once.
- 02Set it as an environment variable
export TYROSEC_TOKEN=tsk_…– all examples read the token from there, never from the code. - 03Send your first request
curl -sS https://app.tyrosec.com/api/v1/hosts -H "Authorization: Bearer $TYROSEC_TOKEN" - 04Examples per endpointThe reference pages show every call in cURL, Python, PHP and JavaScript with an example response.
Reference
- ServersServers, websites, automatic measures
- Alerts & incidentsFilter, fetch, set status of alerts; incidents
- Vulnerabilities & threatsOpen vulnerabilities, attacker IPs
- Clients & reportsClients, monthly PDF reports
- AutomationEnrolment tokens, deploy windows, check
All endpoints
| Method | Path | Description | Scope |
|---|---|---|---|
| GET | /hosts | List servers | Read |
| GET | /hosts/{id} | Get a server | Read |
| PATCH | /hosts/{id} | Assign a server to a client | Write |
| GET | /hosts/{id}/sites | Websites of a server | Read |
| GET | /hosts/{id}/measures | Automatic measures of a server | Read |
| GET | /alerts | List alerts | Read |
| GET | /alerts/{id} | Get an alert | Read |
| PATCH | /alerts/{id} | Set the alert status | Write |
| GET | /incidents | List incidents | Read |
| GET | /vulnerabilities | Open vulnerabilities | Read |
| GET | /threats/ips | Attacker IPs from the tyrosec network | Read |
| GET | /customers | List clients | Read |
| GET | /customers/{name}/report.pdf | Monthly report of a client (PDF) | Read |
| POST | /enroll-tokens | Enrolment token for new servers | Write |
| POST | /hosts/{id}/deploy | Open a deploy window | Write |
| DELETE | /hosts/{id}/deploy | Close a deploy window | Write |
| POST | /hosts/{id}/check | Trigger a compromise check | Write |
Errors
Errors come with a matching HTTP status and a message in the message field:
HTTP 401 {"message": "…"} token missing, expired or not owned by an administrator
HTTP 403 {"message": "…"} account not on the Agency plan, or read-only token
HTTP 404 {"message": "…"} server, alert or client not found
HTTP 422 {"message": "…", "errors": {"status": ["…"]}} invalid parameters
HTTP 429 {"message": "…"} too many requests (120 per minute per token)Webhooks: alerts by push
Instead of polling the API, tyrosec can send new alerts to your own URL: in tyrosec under Notifications, create a channel of type webhook. Each delivery is a JSON POST signed with X-Tyrosec-Signature: sha256=… (HMAC-SHA256 over the body with the channel’s secret).
Example delivery:
{
"source": "tyrosec",
"count": 1,
"url": "https://app.tyrosec.com/alerts?host=7c1b6092-482b-48d9-b40f-fb476bd98176&status=open&alert=87524",
"alerts": [
{
"id": 87524,
"severity": "critical",
"rule": "vulnerable_software",
"title": "Lücke in magento/product-community-edition 2.4.7-p3 (wird aktiv ausgenutzt)",
"detail": "magento/product-community-edition 2.4.7-p3 → Update auf 2.4.7-p4",
"host": {
"id": "7c1b6092-482b-48d9-b40f-fb476bd98176",
"hostname": "shop-01",
"customer": "Beispiel-Shop GmbH"
},
"created_at": "2026-11-17 15:26:20+00",
"url": "https://app.tyrosec.com/alerts?host=7c1b6092-482b-48d9-b40f-fb476bd98176&status=open&alert=87524"
}
]
}Verify the signature
Verify the signature before processing – here in Python, PHP and JavaScript:
# Python
import hashlib, hmac
def valid(body: bytes, header: str, secret: str) -> bool:
"""header = value of X-Tyrosec-Signature, body = raw request body"""
expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, header)
// PHP
<?php
$body = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $body, getenv('TYROSEC_WEBHOOK_SECRET'));
if (!hash_equals($expected, $_SERVER['HTTP_X_TYROSEC_SIGNATURE'] ?? '')) {
http_response_code(401);
exit;
}
$payload = json_decode($body, true);
// JavaScript (Node.js)
import { createHmac, timingSafeEqual } from "node:crypto";
// body = raw request body (Buffer), header = X-Tyrosec-Signature
export function valid(body, header, secret) {
const expected = Buffer.from("sha256=" + createHmac("sha256", secret).update(body).digest("hex"));
const got = Buffer.from(header || "");
return got.length === expected.length && timingSafeEqual(got, expected);
}Frequently asked questions
What does the API cost?
It is included in the Agency plan, also during the free trial. For accounts on other plans, all calls except openapi.json respond with 403.
Can I fetch file contents or diffs?
No. The API returns metadata about servers, alerts and vulnerabilities. File contents, diffs and actions on servers (restore, block) are deliberately available only in the interface, with confirmation.
How secure are the tokens?
tyrosec stores only a SHA-256 hash. A token is only valid while the administrator who created it exists and is an administrator; you can let it expire or revoke it at any time.
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.