Monitoring API
RESTful API for managing monitors, notifications, and accessing monitoring data
Authentication: Use Bearer API key for programmatic access or Supabase session for browser access
Authentication
Header Format
Authorization: Bearer YOUR_SECRETAPI Key Management
POST /api/keys
{
"name": "My API Key",
"scopes": ["monitors:read", "monitors:write"]
}GET /api/keysDELETE /api/keys/:id
Available Scopes
monitors:readmonitors:writeproviders:readproviders:write
Quick Start
1
Create an API key in your account settings2
Include the key in your Authorization header3
Start making API callsBase URL
https://your-domain.com/api
Monitors API
List Monitors
GETGET /api/monitors
?status=up|down
&type=http|ping
&page=1&pageSize=20Create Monitor
POSTPOST /api/monitors
{
"friendly_name": "My Website",
"url": "https://example.com",
"type": "http",
"interval": 60,
"is_active": true
}Get Monitor Details
GETGET /api/monitors/:idUpdate Monitor
PUTPUT /api/monitors/:id
{
"friendly_name": "Updated Name",
"is_active": false
}Get Monitor Incidents
GETGET /api/monitors/:id/incidents?window=24h|30d|6mo|1yNotification Providers API
List Providers
GETGET /api/providersCreate Email Provider
POSTPOST /api/providers
{
"provider_type": "email",
"recipient_email": "alerts@example.com"
}Provider Types & Required Fields
email
recipient_emailslack
webhook_url, channel?, username?telegram
chat_id, tokenSMS
phone_numberMonitor Notifications API
List Assignments
GETGET /api/monitors/:id/notificationsCreate Assignment
POSTPOST /api/monitors/:id/notifications
{
"provider_id": 1,
"enabled": true
}Remove Assignment
DELETEDELETE /api/monitors/:id/notifications
{
"provider_id": 1
}Test Notifications API
Test Provider
POSTPOST /api/providers/:id/test
# Sends a test notification to verify provider configuration
# Returns success/error messageTest Message Examples:
Email: "🧪 Test notification from your monitoring system..."Slack: "🧪 Test notification from your monitoring system..."Telegram: "🧪 Test notification from your monitoring system..."SMS: "Test notification from your monitoring system..."Important Notes
Per-User Access
All endpoints enforce user-level access. API keys are tied to a single user account.
Scope-Based Authorization
API keys require specific scopes for read/write access to different resources.
Row Level Security
Database-level RLS policies are active on monitors, providers, and assignments.
Rate Limiting
API requests are rate limited to ensure service stability and fair usage.