Docs / Reference

API

yasp has three HTTP APIs:

APIPathForAuth
REST API/api/v1Automation: monitors, components, incidents, maintenance, metricsAPI token
Statuspage-compatible API/api/v2/*.jsonReading a status page, for existing Statuspage clientsNone
Probe API/probe/v1Remote probesProbe credentials

This page covers the first two, plus config export/import and the Terraform/OpenTofu provider. The probe API is internal to yasp-probe; see probes.

# Authentication

Create a token under API → New token in the dashboard (admins only). Give it a Name, a Role and an Expires (30 days, 90 days, 1 year or never). The token is shown once; only its hash is stored. Make one per script or integration so you can revoke them separately with Revoke.

Tokens start with yasp_api_, so leaked ones are easy to spot. Send it as a bearer token:

export YASP_TOKEN=yasp_api_…
curl -fsS https://status.example.com/api/v1/me -H "Authorization: Bearer $YASP_TOKEN"

Tokens have a role, not separate scopes:

RoleCan
ViewerRead monitors, components, incidents, alerts and metrics
EditorAlso create, change and delete monitors and components, set component status, post incidents, updates and maintenance, acknowledge alerts, push metric points
AdminAlso list and delete subscribers, and read the audit log

Every change made through the API is in the audit log, with the token's name and prefix. Admin tokens also authenticate SCIM.

# OpenAPI

The OpenAPI 3.1 description is at /api/v1/openapi.json (no token needed), and linked as OpenAPI spec on the API page. Point code generators, Postman or an API explorer at it.

# Errors and limits

Errors are JSON with a stable code:

{"error": {"code": "forbidden", "message": "this token is a viewer; this needs editor"}}
StatusCode
401unauthorized: no token, or it's unknown, revoked or expired
403forbidden: the token's role is too low
404not_found
409conflict: e.g. a slug that already exists
422invalid or invalid_json, with the field and reason in the message
429rate_limited: more than 600 requests a minute for one token

The rate limit is per token and per instance. Lists aren't paginated, except the audit log (below).

IDs are UUIDs. Times in responses are RFC 3339. Times in requests can be RFC 3339 or Unix milliseconds.

# Monitors

Method and pathRole
GET /api/v1/monitors, GET /api/v1/monitors/{id}Viewer
POST /api/v1/monitors, PATCH /api/v1/monitors/{id}, DELETE /api/v1/monitors/{id}Editor

check takes the same fields as the monitor form, with kind one of http, tcp, dns, icmp, tls, statuspage, domain, process, smtp or database. For a heartbeat or alert monitor, send "kind": "heartbeat" or "kind": "alerts" and no check.

curl -fsS -X POST https://status.example.com/api/v1/monitors \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "Checkout API", "check": {"kind": "http", "url": "https://api.example.com/health"}, "interval_s": 60}'

Other fields: slug (from the name if left out), enabled, timeout_ms, retries, degraded_ms, down_after, up_after, quorum (majority, any, all or n:2) and probes (probe IDs; every active probe if left out). PATCH changes only the fields you send. A monitor can't change its kind; make a new one. See monitors for what each setting does.

# Components

Method and pathRole
GET /api/v1/components, GET /api/v1/components/{id}Viewer
POST /api/v1/components, PATCH /api/v1/components/{id}, DELETE /api/v1/components/{id}Editor
PUT /api/v1/components/{id}/status, DELETE /api/v1/components/{id}/statusEditor
curl -fsS -X POST https://status.example.com/api/v1/components \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "API", "description": "REST and GraphQL", "monitors": ["MONITOR_ID"], "sla_target": 99.9}'

Other fields: slug, combine (worst, best or redundant), auto_incident (off, draft or publish), show_uptime, show_response_time, show_regions.

To set a status by hand, for example during a deploy:

curl -fsS -X PUT https://status.example.com/api/v1/components/COMPONENT_ID/status \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"status": "partial_outage", "reason": "Deploy in progress", "expires_in_s": 1800}'

status is operational, degraded_performance, partial_outage, major_outage or under_maintenance. Leave out expires_in_s to keep it until cleared. DELETE on the same path hands the component back to its monitors.

# Incidents and maintenance

Method and pathRole
GET /api/v1/incidents?state=open (or drafts, or recent for the last 30 days)Viewer
GET /api/v1/incidents/{id} (with its updates)Viewer
POST /api/v1/incidentsEditor
POST /api/v1/incidents/{id}/updatesEditor
POST /api/v1/incidents/{id}/publish (a draft)Editor
POST /api/v1/maintenanceEditor
curl -fsS -X POST https://status.example.com/api/v1/incidents \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"title": "Elevated API errors", "body": "We are looking into it.", "impact": "minor",
       "components": [{"id": "COMPONENT_ID", "status": "partial_outage"}]}'

impact is none, minor (the default), major or critical; status is investigating (the default), identified, monitoring or resolved. publish and notify default to true: send "publish": false for a draft, "notify": false to keep it from subscribers. The body is Markdown.

Post an update, and resolve it the same way:

curl -fsS -X POST https://status.example.com/api/v1/incidents/INCIDENT_ID/updates \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"status": "resolved", "body": "Error rates are back to normal."}'

Schedule maintenance:

curl -fsS -X POST https://status.example.com/api/v1/maintenance \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"title": "Database upgrade", "body": "Writes pause for a few minutes.",
       "starts_at": "2026-12-06T02:00:00Z", "ends_at": "2026-12-06T03:00:00Z",
       "components": ["COMPONENT_ID"]}'

auto_start, auto_complete and notify default to true. Updates to maintenance use the statuses scheduled, in_progress, verifying, completed and cancelled. See incidents.

# Alerts, metrics, subscribers and the audit log

Method and pathRoleWhat
GET /api/v1/alertsViewerThe 50 most recent alerts
POST /api/v1/alerts/{id}/ackEditorAcknowledge one (stops escalation)
GET /api/v1/metricsViewerStatus page metrics
POST /api/v1/metrics/{id}/pointsEditorPush points to a metric
GET /api/v1/subscribers?page=SLUGAdminA page's subscribers, with counts: the main page without page, 404 for an unknown slug
DELETE /api/v1/subscribers/{id}AdminRemove one
GET /api/v1/audit?limit=100&before=…AdminAudit entries, newest first
GET /api/v1/meAnyThe token itself

Metrics are created under Status pages → Metrics with Numbers come from: Pushed through the API; the dashboard shows each one's push URL. Push one point (now), or up to 1000 at once:

curl -fsS -X POST https://status.example.com/api/v1/metrics/METRIC_ID/points \
  -H "Authorization: Bearer $YASP_TOKEN" -H "Content-Type: application/json" \
  -d '{"points": [{"value": 182, "timestamp": "2026-11-30T10:00:00Z"}, {"value": 175}]}'

Values must be finite numbers and timestamps not in the future. A point at an existing time replaces it. The answer is 202 with {"accepted": n}.

The audit log takes limit (default 100, at most 1000) and before (an entry id): pass the last id you got to read further back.

# Statuspage-compatible API

Each public status page serves the read endpoints of Atlassian Statuspage's v2 API, with the same paths, field names and values, so existing clients, aggregators and browser extensions read it as-is. No token, open CORS.

PathWhat
/api/v2/summary.jsonStatus, components, unresolved incidents and upcoming or active maintenance
/api/v2/status.jsonThe overall indicator and description
/api/v2/components.jsonComponents
/api/v2/incidents.jsonRecent incidents
/api/v2/incidents/unresolved.jsonOpen incidents
/api/v2/scheduled-maintenances.jsonMaintenance
/api/v2/scheduled-maintenances/upcoming.jsonUpcoming maintenance
/api/v2/scheduled-maintenances/active.jsonMaintenance in progress

The main page serves them at /api/v2/…, other pages at /p/{slug}/api/v2/… and on their custom domain. Private pages answer 404.

curl https://status.example.com/api/v2/summary.json

# Config export and import

Monitors, components, groups, templates, alert channels and page settings fit in one JSON file. Keep it in git, copy it to another yasp, or use it to move between SQLite and Postgres. Secrets are never exported.

From the command line:

yasp config export --out yasp.json     # or to standard output without --out
yasp config import yasp.json --dry-run # show what would change
yasp config import yasp.json           # `-` reads standard input

In the dashboard, Configuration → Download configuration exports, and Import → Preview changes shows every change before Apply these changes. Both need the admin role.

Import matches by slug: what exists is updated, what's new is created, and nothing is deleted. Running it twice changes nothing the second time. Some things to know:

  • Alert channels are only created, never updated. A new webhook channel gets a fresh signing secret. Telegram, PagerDuty and Opsgenie channels need their secret, so add those in the dashboard.
  • Secret check headers are exported without their value. An existing monitor keeps its stored one; a new one needs it added again (the import warns).

The file is configuration only. For history, subscribers and users, use a backup.

# Terraform and OpenTofu

The provider in integrations/terraform-provider-yasp manages monitors and components through the REST API.

terraform {
  required_providers {
    yasp = { source = "yasp-dev/yasp" }
  }
}

provider "yasp" {
  url   = "https://status.example.com" # or YASP_URL
  token = var.yasp_token               # or YASP_TOKEN: an editor or admin token
}

resource "yasp_monitor" "api" {
  name       = "API health"
  interval_s = 60
  check      = jsonencode({ kind = "http", url = "https://api.example.com/health" })
}

resource "yasp_monitor" "nightly_backup" {
  name       = "Nightly backup"
  kind       = "heartbeat"
  interval_s = 86400
}

resource "yasp_component" "api" {
  name       = "API"
  monitors   = [yasp_monitor.api.id]
  sla_target = 99.95
}
ResourceAttributes
yasp_monitorname, slug, kind, check (JSON, same fields as the API), interval_s, timeout_ms, retries, degraded_ms, enabled, quorum, down_after, up_after, probes
yasp_componentname, slug, description, monitors, combine, auto_incident, show_uptime, show_response_time, sla_target

Defaults the server fills into check don't show as changes. Changing a monitor's kind replaces it. Both resources import by ID:

tofu import yasp_monitor.api 0193…

Status pages, groups, alert channels and templates aren't resources yet; use config export/import for those. The provider isn't in the public registries yet: build it and use a dev_overrides block, as its README describes.