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 & incidents The 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

FieldTypeRequiredDescription
namestringYesMonitor name
urlstringYesTarget URL to monitor
typestringYesOne of: http, https, ping, port, keyword, dns, ssl
check_intervalintegerNoSeconds between checks (default: 300, min: 60, max: 86400). May be raised to your plan's minimum.
keywordstringNoKeyword to search for (type: keyword only)
portintegerNoPort 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

FieldTypeDescription
namestringMonitor name
urlstringTarget URL
typestringOne of: http, https, ping, port, keyword, dns, ssl
check_intervalintegerCheck interval in seconds (60–86400)
keywordstringSearch keyword (keyword type)
portintegerPort number (port type)
enabledbooleanEnable 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:

TypeDescriptionRequired Fields
httpMonitor an HTTP endpoint for a 200 responseurl
httpsMonitor an HTTPS endpoint for a 200 response. Also checks SSL certificate validity and expiry.url
pingICMP ping check — is the host reachable?url (hostname or IP)
portTCP port connectivity check — is the port open and accepting connections?url (hostname), port
keywordCheck if a keyword exists (or is absent) in the HTTP response bodyurl, keyword
dnsDNS resolution check — does the hostname resolve to at least one IP?url (hostname)
sslSSL 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):

FieldTypeDescription
idintegerUnique monitor identifier
namestringMonitor name
urlstringTarget URL being monitored
typestringMonitor type: http, https, ping, port, keyword, dns, or ssl
statusstringCurrent status: up, down, pending, or paused
check_intervalintegerSeconds between checks (e.g. 60 for 1-minute intervals)
keywordstring|nullKeyword to search for (keyword type only). null for other types.
portinteger|nullPort number being checked (port type only). null for other types.
response_timeinteger|nullLast response time in milliseconds. null if no check has run yet.
last_checkedinteger|nullUnix timestamp of the last check. null if the monitor has never been checked.
uptime_percentfloat|nullOverall uptime percentage (e.g. 99.95). null if insufficient data.
ssl_expiry_daysinteger|nullDays until the SSL certificate expires (https and ssl types only). null for other types or if not yet checked.
enabledinteger1 if the monitor is active, 0 if paused
incidents_past_24hintegerNumber of incidents that started in the last 24 hours for this monitor
created_atintegerUnix timestamp when the monitor was created
Create response The Create Monitor (POST) response includes only 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