Appearance
Monitors API Reference
This guide provides detailed information about the Monitors API endpoints.
List Monitors
Retrieve a list of all monitors.
http
GET /monitorsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| per_page | integer | Items per page (default: 20) |
| status | string | Filter by status (active/inactive) |
Response
json
{
"data": [
{
"id": "mon_123",
"name": "Website Uptime",
"type": "http",
"status": "active",
"url": "https://example.com",
"created_at": "2024-01-01T00:00:00Z"
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 1
}
}Create Monitor
Create a new monitor.
http
POST /monitorsRequest Body
json
{
"name": "Website Uptime",
"type": "http",
"url": "https://example.com",
"interval": 60,
"regions": ["us-east", "eu-west"]
}Response
json
{
"data": {
"id": "mon_123",
"name": "Website Uptime",
"type": "http",
"status": "active",
"url": "https://example.com",
"created_at": "2024-01-01T00:00:00Z"
}
}Get Monitor
Retrieve details of a specific monitor.
http
GET /monitors/:idResponse
json
{
"data": {
"id": "mon_123",
"name": "Website Uptime",
"type": "http",
"status": "active",
"url": "https://example.com",
"created_at": "2024-01-01T00:00:00Z",
"last_check": {
"status": "up",
"response_time": 150,
"checked_at": "2024-01-01T00:01:00Z"
}
}
}Update Monitor
Update an existing monitor.
http
PUT /monitors/:idRequest Body
json
{
"name": "Updated Monitor Name",
"interval": 120,
"regions": ["us-east", "eu-west", "ap-south"]
}Response
json
{
"data": {
"id": "mon_123",
"name": "Updated Monitor Name",
"type": "http",
"status": "active",
"url": "https://example.com",
"created_at": "2024-01-01T00:00:00Z"
}
}Delete Monitor
Delete a monitor.
http
DELETE /monitors/:idResponse
json
{
"data": {
"id": "mon_123",
"deleted": true
}
}Error Codes
| Code | Description |
|---|---|
| monitor_not_found | The specified monitor does not exist |
| invalid_request | The request parameters are invalid |
| rate_limit | Too many requests |