API Reference

The Upwatch REST API lets you manage monitors, query check results, and access uptime data programmatically.

Base URL:https://app.upwatch.dev/api

Auth:Pass Authorization: Bearer YOUR_JWT_TOKEN on all protected endpoints.

lock

Authentication

POST/api/auth/registerPublic

Create a new account. Returns JWT access and refresh tokens.

Request Body

email string, required
password string, min 8 chars
name string, optional

Response 201

access_token JWT, 15min TTL
refresh_token JWT, 7 day TTL
token_type "bearer"
POST/api/auth/loginPublic

Authenticate with email and password. Returns JWT tokens.

Request Body

email string, required
password string, required
POST/api/auth/refresh

Exchange a refresh token for a new access/refresh token pair. Pass the refresh token as Authorization: Bearer REFRESH_TOKEN.

GET/api/auth/me

Returns the authenticated user's profile: id, email, name, slug, created_at.

monitor_heart

Monitors

GET/api/monitors

List all monitors for the authenticated user. Each includes current status (up/down/unknown) and latest check result.

POST/api/monitors

Create a new monitor. Checks start immediately.

Request Body

name string, required
url string, required
method "GET" | "HEAD", default "GET"
interval_sec 30-3600, default 60
timeout_sec 1-60, default 10
expected_code 100-599, default 200
headers object, optional key-value pairs
tags string[], optional
GET/api/monitors/:id

Get monitor detail including recent checks, active incident, and current status.

PUT/api/monitors/:id

Update monitor settings. Only send fields you want to change. Scheduler automatically reschedules with new settings.

DELETE/api/monitors/:id

Delete a monitor and stop all checks. Returns 204 on success. Check history is retained.

query_stats

Checks & Uptime

GET/api/monitors/:id/checks

Paginated check history for a monitor.

Query Params

range 1h | 6h | 24h | 7d | 30d (default 24h)
page int, default 1
limit 1-200, default 50
GET/api/monitors/:id/uptime

Computed uptime percentages for 24h, 7d, and 30d windows. Cached in Redis for fast reads.

warning

Incidents

GET/api/incidents

List all incidents across your monitors, sorted by most recent. Includes monitor name, cause, duration, and resolution status.

Query Params

limit 1-200, default 50
public

Public Endpoints

GET/api/status/:slugPublic

Public status page data. No authentication required. Returns the owner name and a list of monitors with name, status, and uptime stats (no URLs or config exposed).

GET/healthPublic

API health check. Returns system status, MongoDB connection state, scheduler state, and uptime.

error

Error Responses

All errors return a consistent JSON format:

{ "detail": "Monitor not found", "status_code": 404 }
CodeMeaning
200Success
201Created
204Deleted (no content)
400Invalid input / validation error
401Missing or expired token
404Resource not found
409Conflict (duplicate name/email)