← Back to Dashboard

StatusCore API

Integrate monitoring into your applications

Contents

Authentication

All API requests (except public endpoints) require a Bearer token in the Authorization header.

Getting Your API Token

Use the login endpoint to obtain a JWT token. Include it in all subsequent requests.

POST /api/auth/login

Authenticate and receive a JWT token.

Request Body

ParameterTypeDescription
email requiredstringYour account email
password requiredstringYour password

Example Request

curl -X POST https://portal.statuscore.io/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "yourpassword"}'

Example Response

{
  "user": {
    "id": 1,
    "email": "you@example.com",
    "fullName": "Your Name",
    "subscriptionTier": "pro"
  },
  "token": "eyJhbGciOiJIUzI1NiIs..."
}
GET /api/auth/me Auth Required

Get current user information.

Example Request

curl https://portal.statuscore.io/api/auth/me \
  -H "Authorization: Bearer YOUR_TOKEN"

Monitors

GET /api/monitors Auth Required

List all your monitors with current status, uptime, and location data.

Example Response

[
  {
    "id": 1,
    "name": "Website",
    "type": "https",
    "target": "https://example.com",
    "status": "up",
    "response_time": 145,
    "last_check": "2024-01-15T10:30:00Z",
    "uptime_percentage": "99.95",
    "location_status": {
      "us-east-bca": "up",
      "us-west-oregon": "up",
      "eu-frankfurt": "up"
    }
  }
]
POST /api/monitors Auth Required

Create a new monitor.

ParameterTypeDescription
name requiredstringDisplay name for the monitor
type requiredstringOne of: http, https, ping, tcp, sip, domain, heartbeat
targetstringURL, hostname, or IP to monitor
portintegerPort number (for TCP monitors)
ssl_checkbooleanEnable SSL certificate monitoring
check_locationsarrayLocations to check from: ["all"] or specific locations

Example Request

curl -X POST https://portal.statuscore.io/api/monitors \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production API",
    "type": "https",
    "target": "https://api.example.com/health",
    "ssl_check": true
  }'
PUT /api/monitors/:id Auth Required

Update an existing monitor.

ParameterTypeDescription
namestringDisplay name
targetstringTarget URL/hostname
portintegerPort number
ssl_checkbooleanSSL monitoring
DELETE /api/monitors/:id Auth Required

Delete a monitor and all its history.

PATCH /api/monitors/:id/toggle Auth Required

Enable or disable a monitor.

ParameterTypeDescription
is_active requiredbooleantrue to enable, false to disable
PATCH /api/monitors/:id/public Auth Required

Toggle whether a monitor appears on your public status page.

ParameterTypeDescription
public_status requiredbooleantrue to show on status page

History & Stats

GET /api/monitors/:id/history Auth Required

Get check history for a monitor.

ParameterTypeDescription
hoursintegerNumber of hours of history (default: 24)

Example Response

{
  "monitor": { "id": 1, "name": "Website", ... },
  "history": [
    { "checked_at": "2024-01-15T10:00:00Z", "status": "up", "response_time": 142 },
    { "checked_at": "2024-01-15T10:01:00Z", "status": "up", "response_time": 138 }
  ],
  "stats": {
    "avg": 140,
    "min": 120,
    "max": 180,
    "uptime": "99.9"
  }
}
GET /api/monitors/:id/stats Auth Required

Get detailed statistics for a monitor.

ParameterTypeDescription
daysintegerNumber of days (default: 30)

Incidents & Anomalies

GET /api/monitors/:id/insights Auth Required

Get recent incidents and anomalies for a monitor.

GET /api/monitors/anomalies Auth Required

Get all unacknowledged anomalies across all monitors.

POST /api/monitors/anomalies/:id/acknowledge Auth Required

Acknowledge an anomaly to dismiss it.

Tools

GET /api/monitors/:id/mtr Auth Required

Run an MTR (traceroute) to the monitor's target. Premium feature.

GET /api/monitors/tools/whois/:target Auth Required

Perform a WHOIS lookup on a domain or IP.

Public Status Page

GET /api/public/status/:slug

Get public status page data. No authentication required.

Example Request

curl https://portal.statuscore.io/api/public/status/your-company

Example Response

{
  "company_name": "Your Company",
  "monitors": [
    {
      "id": 1,
      "name": "Website",
      "type": "https",
      "status": "up",
      "uptime_percentage": "99.95",
      "history": [...]
    }
  ],
  "incidents": [
    {
      "id": 5,
      "monitor_name": "Website",
      "started_at": "2024-01-14T08:00:00Z",
      "resolved_at": "2024-01-14T08:15:00Z",
      "status": "resolved"
    }
  ]
}

Webhooks

Configure webhooks in your Dashboard Settings to receive real-time notifications when monitors go up or down.

Webhook Payload

When a monitor status changes, StatusCore sends a POST request to your webhook URL:

{
  "event": "monitor.down",
  "monitor": {
    "id": 1,
    "name": "Production API",
    "type": "https",
    "target": "https://api.example.com",
    "status": "down"
  },
  "timestamp": "2024-01-15T10:30:00.000Z",
  "details": {
    "locations": "US-East (Virginia), US-West (Oregon)"
  }
}

Slack Format

Slack webhooks receive rich formatted messages with attachments and blocks.

Discord Format

Discord webhooks receive embeds with colored status indicators.

Rate Limits

API requests are limited to 100 requests per minute per user. Exceeding this limit will result in a 429 error.

Need help? Contact support@statuscore.io