The public API is the telemetry endpoint your cron jobs and workers call when they start, finish or fail. It is the same contract the SDKs and the dashboard snippets use.
Quick start
1
Create a job monitor
In the dashboard, add a cron job monitor with its schedule and grace period. Note its monitor key.
2
Create an API key
In Settings → API, create a key with the telemetry scope. It is shown once and stored only as a hash, so keep it in a server-side secret.
3
Report each run
Send RUN when the job starts, then COMPLETE or FAIL when it ends. FastMonitor opens an issue if a run fails, runs too long or never arrives.
Send Authorization: Bearer <api-key>. The older X-Api-Key header still works for existing integrations. The key needs the monitor:telemetry or monitor:write scope and can only report for monitors in its own account.
Keep it on the server
Keys are stored as hashes and shown once, when you create them. Never put a key in browser code or in a NEXT_PUBLIC_* variable. If you lose one, create a new key.
Errors and retries
Errors return ok: false with a stable code. Retry 429, 5xx and network errors with exponential backoff, and send the same idempotencyKey on each retry. The SDKs do this for you (two retries, 10 second timeout).
HTTP
code
Meaning
401
UNAUTHENTICATED
No API key on the request.
401
INVALID_API_KEY
The key is unknown or expired, or its user is inactive.
403
INSUFFICIENT_SCOPE
The key has no telemetry scope (monitor:telemetry or monitor:write).
404
MONITOR_NOT_FOUND
No monitor with this key belongs to the key's account.
400
INVALID_STATE
state is not RUN, COMPLETE or FAIL.
400
VALIDATION_ERROR
monitorKey or state is missing, or idempotencyKey is malformed.
400
MONITOR_TYPE_UNSUPPORTED
The monitor is not a job monitor.
429
RATE_LIMITED
Too many requests. Retry with backoff.
500
INTERNAL_ERROR
Something failed on our side. Retry with backoff.
error response
HTTP/1.1 404 Not Found
{
"ok": false,
"code": "MONITOR_NOT_FOUND",
"message": "No monitor exists for this key."
}
SDKs
wrap a job, done
The SDKs are not on npm, PyPI or Packagist yet, so the install commands below will not work until they are published. Until then, use the HTTP call above: the SDKs send exactly that request.
JavaScript / TypeScript
install
npm install @maki/monitor
nightly-import.ts
import { MakiMonitor } from "@maki/monitor";
const monitor = new MakiMonitor({
apiKey: process.env.MAKI_MONITOR_API_KEY!, // server-side secret
});
// Sends RUN, then COMPLETE with the duration, or FAIL if it throws.
await monitor.runJob("nightly-import", async () => {
await importRows();
});
Python
install
pip install makimonitor
daily_report.py
import os
from makimonitor import MonitorClient
client = MonitorClient(api_key=os.environ["MAKI_MONITOR_API_KEY"])
# RUN on enter, COMPLETE on success, FAIL on exception (re-raised).
with client.job("daily-report"):
run_daily_report()
PHP
install
composer require maki/monitor-php
weekly-report.php
use Maki\Monitor\TelemetryClient;
$client = new TelemetryClient(getenv('MAKI_MONITOR_API_KEY'));
// RUN before, COMPLETE on success, FAIL on throw (re-thrown).
$client->job('weekly-report', function () {
(new WeeklyReportJob())->run();
});
The JavaScript SDK also has a Next.js helper, monitorJob from @maki/monitor/next, for route handlers and server actions. Every SDK runs server-side only and never logs your key.
What the API does not do yet
There is no public API for creating or changing monitors, alert settings or billing: you set those up in the dashboard. There is no automation screen in the dashboard yet: our team sets up your automation rules and handles run approvals with you, on request. Uptime, SSL, DNS and broken-link checks run from FastMonitor's side and need no API calls at all. Questions? Get in touch or read the FAQs.