EN
DeutschEnglishРусскийEspañolFrançais
Try for free
FeaturesPricingSecurity & privacyLog in
API

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 URLhttps://app.tyrosec.com/api/v1 – responses in JSON, timestamps in ISO 8601 (UTC).
  • AuthenticationBearer token in the Authorization header. 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 rule and severity are language-independent.

Getting started

  1. 01Create a tokenIn tyrosec under Settings › API: give it a name and choose read or write scope. The token is shown only once.
  2. 02Set it as an environment variableexport TYROSEC_TOKEN=tsk_… – all examples read the token from there, never from the code.
  3. 03Send your first requestcurl -sS https://app.tyrosec.com/api/v1/hosts -H "Authorization: Bearer $TYROSEC_TOKEN"
  4. 04Examples per endpointThe reference pages show every call in cURL, Python, PHP and JavaScript with an example response.

Reference

All endpoints

MethodPathDescriptionScope
GET/hostsList serversRead
GET/hosts/{id}Get a serverRead
PATCH/hosts/{id}Assign a server to a clientWrite
GET/hosts/{id}/sitesWebsites of a serverRead
GET/hosts/{id}/measuresAutomatic measures of a serverRead
GET/alertsList alertsRead
GET/alerts/{id}Get an alertRead
PATCH/alerts/{id}Set the alert statusWrite
GET/incidentsList incidentsRead
GET/vulnerabilitiesOpen vulnerabilitiesRead
GET/threats/ipsAttacker IPs from the tyrosec networkRead
GET/customersList clientsRead
GET/customers/{name}/report.pdfMonthly report of a client (PDF)Read
POST/enroll-tokensEnrolment token for new serversWrite
POST/hosts/{id}/deployOpen a deploy windowWrite
DELETE/hosts/{id}/deployClose a deploy windowWrite
POST/hosts/{id}/checkTrigger a compromise checkWrite

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.