title: "Alerts API" description: "Manage alert rules and view alert history — thresholds for CPU, memory, disk, and offline detection." last_updated: "2026-05-24"

Alerts API

Endpoints under /alerts manage server-level threshold alert rules and expose alert history. Conceptual docs: Alerts overview.

All routes below require a bearer token.

List alert rules

GET/alerts
Auth: bearer

Returns all alert rules on the account, plus current usage against the plan limit.

Response — 200 OK

{
  "rules": [
    {
      "id": 9,
      "user_id": 3,
      "server_id": 12,
      "alert_type": "cpu_high",
      "threshold": 80,
      "enabled": 1,
      "server_name": "web-01",
      "hostname": "web-01.prod",
      "created_at": "2026-04-12T11:23:00Z"
    }
  ],
  "usage": {
    "used": 1,
    "limit": 5,
    "plan": "pro",
    "canCreate": true
  }
}

Plan limits: hobby 1, pro 5, team 20, scale 50.

Create alert rule

POST/alerts
Auth: bearer

Request body

FieldTypeRequiredNotes
alert_typestringyesserver_offline, cpu_high, memory_high, or disk_high.
thresholdintegerconditional1-100. Required for all types except server_offline.
server_idintegernoApply to one server. Omit to apply across all your servers.
{ "alert_type": "cpu_high", "threshold": 85, "server_id": 12 }

Response — 201 Created

{
  "rule": {
    "id": 9,
    "user_id": 3,
    "server_id": 12,
    "alert_type": "cpu_high",
    "threshold": 85,
    "enabled": 1,
    "server_name": "web-01",
    "hostname": "web-01.prod",
    "created_at": "2026-05-24T18:42:11Z"
  }
}

Errors

  • 400 — Invalid alert_type, or threshold outside 1-100.
  • 403LIMIT_REACHED. Body includes usage.used, usage.limit, usage.plan.
  • 404server_id doesn't belong to your account.

Update alert rule

PATCH/alerts/:id
Auth: bearer

Pass any subset of enabled and threshold.

Response — 200 OK

{
  "rule": {
    "id": 9,
    "alert_type": "cpu_high",
    "threshold": 90,
    "enabled": 1,
    "server_name": "web-01",
    "hostname": "web-01.prod"
  }
}

Errors

  • 400 — No updates provided, or threshold out of range.
  • 404 — Alert rule not found.

Delete alert rule

DELETE/alerts/:id
Auth: bearer

Response — 200 OK

{ "message": "Alert rule deleted" }

Errors

  • 404 — Alert rule not found.

Alert history

GET/alerts/history
Auth: bearer

Returns past alerts that have been sent, newest first.

Query parameters

ParamTypeDefaultNotes
limitinteger50Page size.
offsetinteger0Pagination offset.

Response — 200 OK

{
  "history": [
    {
      "id": 1421,
      "user_id": 3,
      "server_id": 12,
      "alert_type": "cpu_high",
      "value": 92,
      "threshold": 80,
      "message": "CPU usage at 92% (threshold: 80%)",
      "sent_at": "2026-05-23T22:14:00Z",
      "channels": "email,webhook",
      "server_name": "web-01",
      "hostname": "web-01.prod"
    }
  ],
  "total": 412,
  "limit": 50,
  "offset": 0
}

There's no acknowledgement endpoint — alerts are informational records, not stateful tickets. Hook deliveries into your incident tracker via webhook alerts.

See also

Was this page helpful?