Monitors API
Create, list, update, and delete uptime monitors. Each monitor includes uptime percentage and incident count for the past 24 hours.
List Monitors
GET ?resource=monitors
Returns all monitors in your account, including uptime percentage and incident count for the past 24 hours.
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://cp.pinguzo.com/api/v1/rest.php?resource=monitors
Response
{
"success": true,
"data": {
"monitors": [
{
"id": 1,
"name": "Example.com HTTPS",
"url": "https://example.com",
"type": "https",
"status": "up",
"check_interval": 60,
"keyword": null,
"port": null,
"response_time": 142,
"last_checked": 1700000000,
"uptime_percent": 99.95,
"ssl_expiry_days": 45,
"enabled": 1,
"incidents_past_24h": 0,
"created_at": 1699000000
}
],
"count": 1
}
}
Get Monitor
GET ?resource=monitors&id={id}
Returns details for a single monitor, including uptime percentage and incident count for the past 24 hours.
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://cp.pinguzo.com/api/v1/rest.php?resource=monitors&id=1"
Response
{
"success": true,
"data": {
"monitor": {
"id": 1,
"name": "Example.com HTTPS",
"url": "https://example.com",
"type": "https",
"status": "up",
"check_interval": 60,
"keyword": null,
"port": null,
"response_time": 142,
"last_checked": 1700000000,
"uptime_percent": 99.95,
"ssl_expiry_days": 45,
"enabled": 1,
"incidents_past_24h": 0,
"created_at": 1699000000
}
}
}
uptime_percent field reflects the monitor's overall uptime. The incidents_past_24h field counts incidents that started in the last 24 hours for this monitor.
Create Monitor
POST ?resource=monitors
Creates a new monitor. Returns HTTP 201 Created on success.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Monitor name |
url | string | Yes | Target URL to monitor |
type | string | Yes | One of: http, https, ping, port, keyword, dns, ssl |
check_interval | integer | No | Seconds between checks (default: 300, min: 60, max: 86400). May be raised to your plan's minimum. |
keyword | string | No | Keyword to search for (type: keyword only) |
port | integer | No | Port number (type: port only) |
Example Request
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"My Website","url":"https://example.com","type":"https","check_interval":60}' \
https://cp.pinguzo.com/api/v1/rest.php?resource=monitors
Response (201)
{
"success": true,
"data": {
"monitor": {
"id": 10,
"name": "My Website",
"url": "https://example.com",
"type": "https"
}
}
}
Update Monitor
PUT ?resource=monitors&id={id}
Updates a monitor. All fields are optional — only provided fields are updated.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Monitor name |
url | string | Target URL |
type | string | One of: http, https, ping, port, keyword, dns, ssl |
check_interval | integer | Check interval in seconds (60–86400) |
keyword | string | Search keyword (keyword type) |
port | integer | Port number (port type) |
enabled | boolean | Enable or pause the monitor |
Example Request
curl -X PUT \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"My Website (Updated)","check_interval":120}' \
"https://cp.pinguzo.com/api/v1/rest.php?resource=monitors&id=10"
Response
{
"success": true,
"data": { "message": "Monitor updated" }
}
Delete Monitor
DELETE ?resource=monitors&id={id}
Deletes a monitor and all its associated incidents.
Example Request
curl -X DELETE \
-H "Authorization: Bearer YOUR_API_KEY" \
"https://cp.pinguzo.com/api/v1/rest.php?resource=monitors&id=10"
Response
{
"success": true,
"data": { "message": "Monitor deleted" }
}
Monitor Types
The following monitor types are supported. Each type requires different input fields:
| Type | Description | Required Fields |
|---|---|---|
http | Monitor an HTTP endpoint for a 200 response | url |
https | Monitor an HTTPS endpoint for a 200 response. Also checks SSL certificate validity and expiry. | url |
ping | ICMP ping check — is the host reachable? | url (hostname or IP) |
port | TCP port connectivity check — is the port open and accepting connections? | url (hostname), port |
keyword | Check if a keyword exists (or is absent) in the HTTP response body | url, keyword |
dns | DNS resolution check — does the hostname resolve to at least one IP? | url (hostname) |
ssl | SSL certificate validity check — is the certificate valid and not expired? | url (hostname) |
Monitor Object Fields
The following fields are returned in monitor responses (List and Get Monitor):
| Field | Type | Description |
|---|---|---|
id | integer | Unique monitor identifier |
name | string | Monitor name |
url | string | Target URL being monitored |
type | string | Monitor type: http, https, ping, port, keyword, dns, or ssl |
status | string | Current status: up, down, pending, or paused |
check_interval | integer | Seconds between checks (e.g. 60 for 1-minute intervals) |
keyword | string|null | Keyword to search for (keyword type only). null for other types. |
port | integer|null | Port number being checked (port type only). null for other types. |
response_time | integer|null | Last response time in milliseconds. null if no check has run yet. |
last_checked | integer|null | Unix timestamp of the last check. null if the monitor has never been checked. |
uptime_percent | float|null | Overall uptime percentage (e.g. 99.95). null if insufficient data. |
ssl_expiry_days | integer|null | Days until the SSL certificate expires (https and ssl types only). null for other types or if not yet checked. |
enabled | integer | 1 if the monitor is active, 0 if paused |
incidents_past_24h | integer | Number of incidents that started in the last 24 hours for this monitor |
created_at | integer | Unix timestamp when the monitor was created |
id, name, url, and type. The full set of fields becomes available once the first check completes and the status changes from pending to up or down.
Next Steps
- Incidents API — list and filter incidents for your monitors
- Error Codes — full error reference
- Code Examples — copy-paste snippets