{
  "name": "kavavak-psa",
  "description": "Kavavak PSA: tickets. First slice: tickets raised from Level alerts forwarded by api.pixid.io.",
  "docs": "API.md in the kavavak repo (apps/psa/API.md)",
  "auth": {
    "ingest": "X-Pixid-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>, the secret of the api.pixid.io subscription. Rejected if more than 300 s off."
  },
  "conventions": {
    "ids": "Every record has a uuid id (internal) and a number (what people quote). Responses show the number.",
    "errors": "{ \"ok\": false, \"error\": \"<code>\", \"message\": \"<text>\" } with a matching HTTP status.",
    "delivery": "At least once, any order. Deduplicated on X-Pixid-Event-Id; a repeat answers 200 with \"duplicate\": true.",
    "tickets": "One ticket per Level alert id. alert_active raises it; every event for that alert is linked to it. alert_resolved does not change the ticket yet.",
    "retries": "2xx = done. 401/400 = rejected. 422 = unknown company (fix configuration; the gateway keeps retrying). 5xx = try again."
  },
  "routes": [
    {
      "method": "GET",
      "path": "/api/",
      "description": "This index."
    },
    {
      "method": "GET",
      "path": "/healthz",
      "description": "Liveness: plain \"ok\"."
    },
    {
      "method": "POST",
      "path": "/ingest/v1/level",
      "description": "Level event forwarded by api.pixid.io. Body is the Level payload verbatim; metadata in X-Pixid-* headers."
    }
  ]
}