Skip to main content

API Documentation

REST API v1 – Available on Enterprise plans

Authentication

All API requests require a Bearer token in the Authorization header. Generate API keys from Settings.

curl -H "Authorization: Bearer sg_live_your_key_here" \ https://siteguardian.io/api/v1/monitors

Rate limit: 120 requests per minute per API key. Exceeding this returns 429 Too Many Requests.

Response Format

All responses return JSON with a consistent structure:

// Success
{
  "data": { ... },
  "meta": { "timestamp": "2026-03-20T14:30:00+00:00" }
}

// Paginated
{
  "data": [ ... ],
  "meta": { "total": 42, "limit": 50, "offset": 0 }
}

// Error
{
  "detail": "Monitor not found."
}

Endpoints

M Monitors

Method Endpoint Description
GET/api/v1/monitorsList all monitors
POST/api/v1/monitorsCreate a monitor
GET/api/v1/monitors/:idGet monitor details
PATCH/api/v1/monitors/:idUpdate monitor settings
DELETE/api/v1/monitors/:idDelete monitor
POST/api/v1/monitors/:id/pausePause monitoring
POST/api/v1/monitors/:id/resumeResume monitoring
Example: Create a monitor
curl -X POST https://siteguardian.io/api/v1/monitors \
  -H "Authorization: Bearer sg_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "name": "My Website",
    "check_type": "all"
  }'
Example: Update monitor settings
curl -X PATCH https://siteguardian.io/api/v1/monitors/:id \
  -H "Authorization: Bearer sg_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "ssl_warn_days": 14,
    "rt_alert_enabled": true,
    "rt_sensitivity": 2.5
  }'

C Check Results

Method Endpoint Description
GET/api/v1/monitors/:id/checksList check results (paginated)
GET/api/v1/monitors/:id/uptimeGet uptime percentage
Query parameters

limit – Results per page (1-500, default 50)

offset – Skip N results (default 0)

check_type – Filter: http, ssl, domain, email, pagespeed

days – Uptime calculation period (1-365, default 30)

A Alerts

Method Endpoint Description
GET/api/v1/alertsList recent alerts (paginated)
GET/api/v1/alerts/:idGet single alert

I Incidents

Method Endpoint Description
GET/api/v1/incidentsList incidents (filter: ?status=open)
PATCH/api/v1/incidents/:id/acknowledgeAcknowledge incident
PATCH/api/v1/incidents/:id/resolveResolve incident
Example: Resolve an incident
curl -X PATCH https://siteguardian.io/api/v1/incidents/:id/resolve \
  -H "Authorization: Bearer sg_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "note": "Fixed the DNS configuration" }'

K API Keys

Method Endpoint Description
POST/api/v1/api-keysGenerate new API key (returns key once)
GET/api/v1/api-keysList API keys (prefix only)
DELETE/api/v1/api-keys/:idRevoke API key

Important: The full API key is only returned once when created. Store it securely – we only keep a hash.

Alert Types

Type Description
downMonitor is down (HTTP error or timeout)
recoveredMonitor recovered from downtime
ssl_expiringSSL certificate expires within threshold
domain_expiringDomain expires within threshold
response_timeResponse time anomaly detected
email_blacklistedIP listed on DNS blacklist
email_issuesCritical email health issue (SPF/DKIM/DMARC)

HTTP Status Codes

Code Meaning
200Success
201Resource created
400Bad request (invalid input)
401Unauthorized (missing or invalid API key)
403Forbidden (plan limit reached)
404Resource not found
429Rate limit exceeded