Skip to content

Alerts API Reference

This guide provides detailed information about the Alerts API endpoints.

List Alerts

Retrieve a list of all alerts.

http
GET /alerts

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 20)
statusstringFilter by status (active/resolved)
monitor_idstringFilter by monitor ID

Response

json
{
  "data": [
    {
      "id": "alt_123",
      "monitor_id": "mon_123",
      "type": "down",
      "status": "active",
      "message": "Website is down",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 1
  }
}

Create Alert

Create a new alert.

http
POST /alerts

Request Body

json
{
  "monitor_id": "mon_123",
  "type": "down",
  "message": "Website is down",
  "channels": ["email", "slack"],
  "threshold": {
    "value": 1000,
    "operator": ">",
    "duration": 300
  }
}

Response

json
{
  "data": {
    "id": "alt_123",
    "monitor_id": "mon_123",
    "type": "down",
    "status": "active",
    "message": "Website is down",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Get Alert

Retrieve details of a specific alert.

http
GET /alerts/:id

Response

json
{
  "data": {
    "id": "alt_123",
    "monitor_id": "mon_123",
    "type": "down",
    "status": "active",
    "message": "Website is down",
    "created_at": "2024-01-01T00:00:00Z",
    "resolved_at": null,
    "notifications": [
      {
        "channel": "email",
        "sent_at": "2024-01-01T00:00:05Z",
        "status": "delivered"
      }
    ]
  }
}

Update Alert

Update an existing alert.

http
PUT /alerts/:id

Request Body

json
{
  "status": "resolved",
  "message": "Website is back up"
}

Response

json
{
  "data": {
    "id": "alt_123",
    "monitor_id": "mon_123",
    "type": "down",
    "status": "resolved",
    "message": "Website is back up",
    "created_at": "2024-01-01T00:00:00Z",
    "resolved_at": "2024-01-01T00:05:00Z"
  }
}

Alert Types

TypeDescription
downService is down
upService is back up
slowResponse time exceeds threshold
errorError rate exceeds threshold
customCustom alert condition

Notification Channels

ChannelDescription
emailEmail notifications
slackSlack webhook notifications
webhookCustom webhook notifications
smsSMS notifications

Error Codes

CodeDescription
alert_not_foundThe specified alert does not exist
invalid_requestThe request parameters are invalid
rate_limitToo many requests

Next Steps