Admin endpoints
Authentication, running checks on demand and reading the notification log.
Every mutation lives behind one authenticated prefix, so a public status page can never be edited by its visitors.
Authentication
The token is read from adminToken in the configuration, falling back to the
HEYO_STATUS_API_TOKEN environment variable — Workers and Deno do not always
expose process.env, so both paths exist.
| Situation | Response |
|---|---|
| No token configured | 503 { "error": "The management API is disabled. Set adminToken or HEYO_STATUS_API_TOKEN." } |
| Missing or wrong header | 401 { "error": "Unauthorized." } |
Comparison is constant time, and the header is matched case-insensitively
against Bearer <token>.
A freshly deployed status page is not writable by anyone. Setting the token is a deliberate act, not something you can forget into being insecure.
Generate one with openssl rand -hex 32, store it as a platform secret, and
rotate it by updating the secret — there is no token list to maintain.
POST /admin/checks/run
Runs every configured monitor once, stores the results, reconciles automatic incidents and dispatches notifications. It is the same code path as the scheduler.
| Response | When |
|---|---|
200 | Results array. |
501 | { "error": "Manual checks require the status-page runtime." } — the app was built with createStatusApp() without a runChecks option. |
Useful as an external trigger for a platform without cron, as a deploy-time warm-up so the page is never empty, and when verifying a monitor change.
Summarize and cleanup have no route. Run them with heyo-status, with
scheduleStatusPage(), or through your platform's cron integration.
GET /admin/notifications/log
Every delivery attempt, newest first.
| Query | Type | Notes |
|---|---|---|
channelId | string | exact match |
eventType | any event name | comma-separated |
status | sent, failed | comma-separated |
limit | non-negative integer | |
offset | non-negative integer |
The log stores no payload, no webhook URL, no credentials and no recipient. It exists to debug delivery, not to replay it.
Incident and maintenance management
Documented in full on Incident and maintenance endpoints:
| Method | Path |
|---|---|
| POST | /admin/incidents |
| POST | /admin/incidents/:id/updates |
| PATCH | /admin/incidents/:id |
| DELETE | /admin/incidents/:id |
| POST | /admin/maintenance |
| PATCH | /admin/maintenance/:id |
| DELETE | /admin/maintenance/:id |
Scripting it
For a local or CI context, the CLI does the same without a token or a network round trip — it talks to the database directly: