Incidents API
List and filter incidents for your account. This endpoint is read-only (GET).
List Incidents
GET ?resource=incidents
Returns incidents for your account with optional filtering by time range, entity type, entity ID, status, and pagination. Results are ordered by started_at descending (most recent first).
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | all | Filter by status: open, resolved (or closed), all |
entity_type | string | — | Filter by entity type: server or monitor |
monitor_id | integer | — | Filter incidents for a specific monitor (auto-sets entity_type=monitor) |
server_id | integer | — | Filter incidents for a specific server (auto-sets entity_type=server) |
from | integer | — | Unix timestamp — incidents started at or after this time |
to | integer | — | Unix timestamp — incidents started at or before this time |
last_hours | integer | — | Convenience filter: incidents from the last N hours (e.g. last_hours=24). Ignored if from/to is set. |
page | integer | 1 | Page number for pagination |
limit | integer | 20 | Rows per page (1–200) |
Example: All incidents in the past 24 hours
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://cp.pinguzo.com/api/v1/rest.php?resource=incidents&last_hours=24"
Example: Open incidents for a specific monitor
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://cp.pinguzo.com/api/v1/rest.php?resource=incidents&monitor_id=5&status=open"
Example: Server incidents in a date range
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://cp.pinguzo.com/api/v1/rest.php?resource=incidents&entity_type=server&from=1700000000&to=1700086400"
Response
{
"success": true,
"data": {
"incidents": [
{
"id": 42,
"unique_key": "usny11700000000a1b2c3d4",
"edge_server_id": "us-ny-1",
"entity_type": "monitor",
"entity_id": 5,
"message": "Monitor is down: Connection timed out",
"trigger_type": "https_error",
"started_at": 1700000000,
"resolved_at": null,
"duration_seconds": null,
"notifications_sent": 1,
"acknowledged": 0,
"acknowledged_at": null,
"created_at": 1700000000,
"updated_at": 1700000000,
"monitor_name": "My Website",
"monitor_url": "https://example.com",
"monitor_type": "https",
"status": "open"
}
],
"total": 1,
"page": 1,
"limit": 20,
"pages": 1
}
}
Entity name enrichment
When the incident is for a monitor, the response includes
monitor_name, monitor_url, and monitor_type. When the incident is for a server, the response includes server_name. If the entity has been deleted, the name fields will be null.
Status field
Each incident includes a computed
status field ("open" if resolved_at is null, "resolved" otherwise) in addition to the raw resolved_at timestamp.
Next Steps
- Error Codes — full error reference
- Code Examples — copy-paste snippets