Skip to content

REST API

The PathWatch REST API is the same API the web app uses — there are no internal-only endpoints. Anything you can do in the app, you can do programmatically.

Base URL

https://api.pathwatch.app/api/v1

Authentication

Two methods:

API keys — the method for programmatic access. Create one at Settings → API keys (format pw_live_..., shown once) and send it as a bearer token:

Authorization: Bearer pw_live_xxxxxxxxxxxxxxxx

Each API key is bound to one organisation and carries scopes that cap what it can touch:

ScopeGrants
org:adminAll scopes below
monitors:read / monitors:writeMonitors, check results, groups, maintenance windows
alerts:read / alerts:writeAlert channels, rules, history, escalation policies
status_pages:read / status_pages:writeStatus pages and themes
runners:read / runners:writeSelf-hosted runners
incidents:read / incidents:writeIncidents

A key can never grant more than its creator’s own role permits.

Session cookies — used by the web app after sign-in. Not intended for programmatic access; use an API key instead. Session-authenticated users who belong to multiple organisations can target a specific one by sending an X-Org-Id header (membership is verified); otherwise requests run against the default organisation.

Versioning

All endpoints are under /api/v1/. Breaking changes go in /api/v2/ with at least 6 months overlap. Non-breaking additions ship under v1.

Pagination

Collection endpoints use page-based pagination:

Query paramDefaultRange
page1≥ 1
limit201–100

Requests with limit above 100 are rejected with a validation error — page through instead. Paginated responses share one envelope:

{
"data": [ ... ],
"pagination": {
"page": 1,
"limit": 20,
"total": 57,
"totalPages": 3,
"hasMore": true
}
}

Errors

All errors return a consistent JSON body:

{
"error": "Monitor 'mon_123' not found",
"code": "NOT_FOUND",
"details": { }
}

error is a human-readable message, code is a stable machine-readable identifier, and details is included only when there is structured context (e.g. validation issues, the missing entitlement, or retry timing).

HTTP statuscodeWhen
400VALIDATION_ERRORRequest body or query params failed validation (details lists the issues)
403PERMISSION_DENIEDYour role or API-key scope doesn’t allow the action
403ENTITLEMENT_REQUIREDThe feature isn’t included in your plan (details.entitlement names it)
404NOT_FOUNDResource doesn’t exist or belongs to another organisation
409CONFLICTThe request conflicts with current state (e.g. duplicate slug)
429RATE_LIMIT_EXCEEDEDToo many requests (details.retryAfterSeconds says how long to wait)
500INTERNAL_ERRORSomething broke on our side — safe to retry with backoff

Rate limits

Every /api/v1/* request counts against a fixed one-minute window:

ContextLimit
Authenticated (per organisation)300 requests/min
Unauthenticated (per IP)10 requests/min

Each response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets). Going over returns 429 with the error body above.

Sign-in, sign-up and password-reset endpoints have separate, much tighter per-IP limits to block brute-force attempts.

Resource catalogue

Everything below lives under the base URL. Endpoints follow standard REST conventions (GET list/read, POST create, PATCH update, DELETE remove); the OpenAPI spec documents every route, parameter and response shape.

Monitoring

ResourcePathPurpose
Monitors/monitorsCreate, configure, pause/resume (single and bulk), run-now and delete monitors of every check type
Check results/monitors/:id/checksRaw per-check results with filters, single-result detail, and CSV/JSON export (/checks/export)
Uptime & aggregates/monitors/:id/uptime, /monitors/:id/aggregatesUptime percentages and summarised history for charts and SLA reporting
Monitor groups/monitor-groupsTag-style grouping used by dashboards and alert-rule scoping
Maintenance windows/maintenance-windowsScheduled (optionally recurring) windows that suppress alerts and/or pause monitors
Locations/locationsThe user-facing city list your plan can check from
Regions/regionsThe cloud regions backing those locations, with health state
Flow step palette/plugins/flow/componentsMetadata for every browser-flow step type (used to build flow editors)

Alerting

ResourcePathPurpose
Alert channels/alert-channelsNotification destinations (email, Slack, webhook, PagerDuty, …) incl. test-send
Alert rules/alert-rulesConditions that fire alerts, their scope, confirmation settings and channel bindings; active-alert list and acknowledge
Alert history/alerts/historyEvery notification sent: rule, channel, monitor and delivery outcome
Alert capabilities/alert-capabilitiesWhich channel types and alerting features your plan includes
Escalation policies/escalation-policiesMulti-step escalation chains with per-step delays
Notifications/notificationsIn-app notification feed (list, mark read)

Status pages & incidents

ResourcePathPurpose
Status pages/status-pagesPages, sections, components, access control, custom domains and subscribers
Themes/themesBuilt-in and custom status-page themes
Incidents/incidentsIncident lifecycle: create, update, post updates, resolve

Infrastructure

ResourcePathPurpose
Runners/runnersRegister and manage self-hosted runners (returns the one-time rt_ token on create)

Organisation & account

ResourcePathPurpose
Organisations/orgs, /orgList your orgs; manage the active org’s settings and members
Roles/org/rolesSystem and custom roles with their permission matrix
Security policy/org/security-policyOrg-wide requirements such as mandatory 2FA
Invitations/org/invitations, /invitationsSend and accept membership invitations
User/userYour profile, sessions, data export and account deletion
API keys/api-keysCreate, list and revoke API keys
Audit log/audit-logWho changed what, when (admin read)
Entitlements/entitlementsPlans, your active entitlements and slot usage
Billing/billingSubscription state, checkout and invoices (Paddle-backed)
Retention/retentionYour org’s effective data retention window

Real-time events

GET /events is a Server-Sent Events (SSE) stream the web app uses for live updates (check results, status changes). Connect with an Accept: text/event-stream request to consume the same stream.

Public endpoints

A few endpoints are deliberately unauthenticated:

  • GET|POST /heartbeat/:tokenheartbeat monitor ping endpoint; the token is the credential.
  • Public status-page views and uptime badges — readable by anyone you share the URL with (subject to the page’s access mode).
  • /unsubscribe — one-click unsubscribe links in notification emails; the signed token in the URL is the proof of identity.

OpenAPI spec

The full machine-readable spec (OpenAPI 3.1) is published at:

https://api.pathwatch.app/openapi.json
https://api.pathwatch.app/api/v1/openapi.json

Both URLs serve the same document. Import it into Swagger UI, Postman, Insomnia or Hoppscotch for an interactive explorer, or generate typed clients with openapi-typescript, openapi-generator, or any other OpenAPI tool — the PathWatch web app itself is built from a client generated from this spec.