HTTP check-in API for scheduled jobs

The Alert51 cron monitoring API: one authenticated POST per run reports the result and schedule of a cron job, backup or CI pipeline. Examples cover curl, Node.js fetch and GitLab CI. Every example reads the API base URL from $ALERT51_URL, which is https://api.alert51.com.

AI instructions

Quickstart

  1. Create an account and verify your email address.
  2. Create an API token in the dashboard under API tokens. Copy the secret; it is shown once.
  3. Set two environment variables where your job runs.
  4. Add the check-in request after the command you want to watch.
Environment
export ALERT51_URL="https://api.alert51.com"
export ALERT51_TOKEN="a51_xxxxxxxx_your-secret"
Report a successful backup
./backup.sh && curl --fail-with-body --silent --show-error \
  --max-time 10 \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "project": "production",
    "job": "db-backup",
    "status": "success",
    "cron": "0 */12 * * *",
    "timezone": "Europe/Moscow",
    "graceSeconds": 900
  }' \
  "$ALERT51_URL/v1/check-ins"

The first check-in creates the project production and the monitor db-backup, stores the schedule and starts watching. Run it once by hand to see the monitor appear. Because of &&, a failed backup sends nothing, and Alert51 opens a missed incident after the deadline. To alert at once instead, report "status": "failure" (see the examples below).

AI Instructions

Open raw Markdown

A self-contained integration guide for coding agents. Give an agent the raw file at /ai-instructions.md or paste the copied text into its prompt. This chapter is rendered from the same file.

This guide is for coding agents and the developers who use them. It describes everything needed to add Alert51 monitoring to an existing scheduled job without reading the website. Raw file: https://alert51.com/ai-instructions.md. Human docs: https://alert51.com/docs. OpenAPI spec: https://api.alert51.com/v1/openapi.json.

What Alert51 does

Alert51 watches scheduled jobs: cron jobs, backups, CI pipeline schedules, framework schedulers and timers. After each run the job sends one HTTP check-in with its result. Alert51 stores the job's cron schedule, computes when the next run must report, and opens an incident when:

  • a run reports "status": "failure" (the incident opens at once), or
  • no check-in arrives before the deadline: the next scheduled time plus the grace period (a missed run).

Monitoring starts with the first accepted check-in for a project and job pair. That request creates the project and the monitor; nothing has to be set up in the dashboard first, and nothing is watched before that request succeeds. Notifications go to the channels configured in the dashboard (email, Telegram, webhooks).

Rules for agents

  1. Inspect the existing job before changing anything: where it is scheduled (crontab, systemd timer, Kubernetes CronJob, CI schedule, an in-process scheduler), its exact schedule and time zone, how long it usually runs, and how it reports failure (exit code, exception, return value).
  2. Make the smallest integration change: one check-in after the job's work finishes, in the code path that already knows the outcome. Do not refactor the job, rename it or change its schedule.
  3. Never change the job's outcome. Keep its exit code and re-raise its original exception, even if the check-in request fails. Log reporting errors and continue.
  4. Use a finite HTTP timeout of about 10 seconds for the check-in request.
  5. Read the token from the ALERT51_TOKEN environment variable or the project's existing secret store. Never hard-code, commit, print or log a real token. Use placeholders such as a51_xxxxxxxx_your-secret in examples and add ALERT51_TOKEN= to .env.example if the project keeps one.
  6. Use the HTTP client the project already has. Do not add a dependency just for Alert51.
  7. Send the check-in after the work completes, not when it starts. Alert51 has no start signal.
  8. Choose stable slugs: project for the environment or system (for example production), job for the task (for example db-backup). The same pair must be used on every run.

Get an API token

  1. Sign up at https://alert51.com/signup and verify the email address.
  2. Open the dashboard page API tokens (https://alert51.com/app/tokens) and create a token. Name it after where it runs, for example backup-server-1 or gitlab-ci.
  3. Copy the secret. It is shown once and looks like a51_xxxxxxxx_your-secret.
  4. Store it as ALERT51_TOKEN in the place where the job runs: a CI masked variable, a Kubernetes Secret, a vault, a systemd EnvironmentFile, or an uncommitted .env file.

An agent cannot create tokens. Ask the user to create one and to put it in the secret store, and reference it only by name.

Endpoint

text
POST https://api.alert51.com/v1/check-ins

The same API is also served on the web origin as POST https://alert51.com/api/v1/check-ins. Examples in this guide build the URL as $ALERT51_URL/v1/check-ins with ALERT51_URL defaulting to https://api.alert51.com. Set ALERT51_URL=https://alert51.com/api, or https://your-host/api for a self-hosted instance, to use the web origin.

Headers:

  • Authorization: Bearer <token> (required)
  • Content-Type: application/json (required)
  • Idempotency-Key: <key> (optional, see Idempotency)

The body is a JSON object of at most 16 KB. Unknown fields are rejected.

Request fields

  • project (required): slug matching ^[a-z0-9][a-z0-9_.-]{0,62}$. Input is trimmed and lowercased.
  • job (required): slug with the same pattern, unique inside the project.
  • status (required): success or failure. No other values are accepted.
  • cron (required on the first check-in): five-field cron expression, for example 0 3 * * *. Omit it later to keep the stored schedule; a different value updates the schedule.
  • timezone (optional): IANA time zone such as Europe/Berlin. Default UTC.
  • graceSeconds (optional): integer from 0 to 604800 (7 days). Default 300.
  • scheduledAt (optional): ISO 8601 date-time with an offset, the scheduled time this run belongs to. Must be within 7 days in the past and 5 minutes in the future.
  • name (optional): display name, 1 to 120 characters. Defaults to the job slug.
  • message (optional): up to 1000 characters, for example the error text of a failed run. Truncate longer text and never include secrets.
  • durationMs (optional): run duration in milliseconds, a non-negative integer.

The first check-in for a job must include cron; without it the API answers 422 cron_required. Send timezone and graceSeconds on the first check-in too, because the defaults (UTC, 300 seconds) are stored when the monitor is created. Later check-ins may send only project, job and status. Sending the same cron, timezone and graceSeconds on every run is also fine and keeps the schedule in code; Alert51 only records a schedule change when a value differs.

Minimal curl example

First check-in, which creates the monitor:

bash
curl --fail-with-body --silent --show-error --max-time 10 \
  -X POST "${ALERT51_URL:-https://api.alert51.com}/v1/check-ins" \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"project":"production","job":"db-backup","status":"success","cron":"0 3 * * *","timezone":"UTC","graceSeconds":1800}'

Later runs can omit the schedule:

bash
curl --fail-with-body --silent --show-error --max-time 10 \
  -X POST "${ALERT51_URL:-https://api.alert51.com}/v1/check-ins" \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"project":"production","job":"db-backup","status":"success"}'

Match the job's schedule

  • cron must be the expression that actually triggers the job, with exactly five fields: minute, hour, day of month, month, day of week. Macros such as @daily and six-field expressions with seconds are rejected (422 invalid_cron). Write 0 0 * * * instead of @daily, and drop the leading seconds field of Spring or Quartz expressions.
  • timezone must be the zone the scheduler evaluates the expression in. Crontab uses the server's local zone unless CRON_TZ is set; Kubernetes CronJobs use .spec.timeZone or the controller's zone (usually UTC); GitHub Actions schedules are UTC; GitLab pipeline schedules have their own time zone setting. A wrong zone produces false missed-run alerts.
  • graceSeconds is how long after the scheduled time the check-in may arrive. The check-in is sent when the job ends, so set it above the job's longest normal duration plus any start delay, for example 1800 for a backup that takes up to 20 minutes.
  • If a schedule cannot be expressed in cron (for example some systemd OnCalendar values), use the closest cron expression and a larger grace period.
  • Each check-in is assigned to the latest scheduled time at or before the time it is received plus 60 seconds of early tolerance. If runs can start late (queues, retries), send scheduledAt with the intended scheduled time so the run is matched to the right slot. Reports older than the latest applied one are stored as stale and do not change the monitor.
  • The deadline is the next scheduled time after the run's slot plus graceSeconds. The response returns nextRunAt and deadlineAt; check them after the first check-in.

Failures and missed runs

  • Explicit failure: when the job fails and can still run code, send "status": "failure" with a short message. Alert51 opens an incident with cause failure at once. The next success resolves it.
  • Missed run: if no check-in arrives by deadlineAt, Alert51 opens an incident with cause missed. This covers crashes, killed processes, stopped servers and disabled schedulers, so a job that dies without reporting is still detected.
  • Do not report success from a code path that also runs after a failure, and do not report at the start of the job.

Integration patterns

Shell wrapper that keeps the job's exit code:

bash
#!/bin/sh
started=$(date +%s)
/opt/scripts/backup.sh
code=$?
if [ "$code" -eq 0 ]; then status=success; else status=failure; fi
duration_ms=$(( ($(date +%s) - started) * 1000 ))
curl --fail-with-body --silent --show-error --max-time 10 \
  -X POST "${ALERT51_URL:-https://api.alert51.com}/v1/check-ins" \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"project\":\"production\",\"job\":\"db-backup\",\"status\":\"$status\",\"cron\":\"0 3 * * *\",\"timezone\":\"UTC\",\"graceSeconds\":1800,\"durationMs\":$duration_ms}" \
  || echo "Alert51 check-in failed" >&2
exit "$code"

Node.js 18 or later with the built-in fetch:

javascript
async function reportToAlert51(status, startedAt, message) {
  try {
    const response = await fetch(`${process.env.ALERT51_URL ?? 'https://api.alert51.com'}/v1/check-ins`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.ALERT51_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        project: 'production',
        job: 'db-backup',
        status,
        cron: '0 3 * * *',
        timezone: 'UTC',
        graceSeconds: 1800,
        durationMs: Date.now() - startedAt,
        message: message?.slice(0, 1000),
      }),
      signal: AbortSignal.timeout(10_000),
    });
    if (!response.ok) console.error(`Alert51 check-in rejected: ${response.status} ${await response.text()}`);
  } catch (error) {
    console.error(`Alert51 check-in failed: ${error}`);
  }
}

const startedAt = Date.now();
try {
  await runBackup();
} catch (error) {
  await reportToAlert51('failure', startedAt, String(error));
  throw error;
}
await reportToAlert51('success', startedAt);

Python 3 with the standard library:

python
import json
import os
import sys
import time
import urllib.request


def report_to_alert51(status, started, message=None):
    try:
        body = {
            "project": "production",
            "job": "db-backup",
            "status": status,
            "cron": "0 3 * * *",
            "timezone": "UTC",
            "graceSeconds": 1800,
            "durationMs": int((time.monotonic() - started) * 1000),
        }
        if message:
            body["message"] = message[:1000]
        request = urllib.request.Request(
            os.environ.get("ALERT51_URL", "https://api.alert51.com") + "/v1/check-ins",
            data=json.dumps(body).encode(),
            headers={"Authorization": "Bearer " + os.environ["ALERT51_TOKEN"], "Content-Type": "application/json"},
            method="POST",
        )
        with urllib.request.urlopen(request, timeout=10):
            pass
    except Exception as error:
        print(f"Alert51 check-in failed: {error}", file=sys.stderr)


started = time.monotonic()
try:
    run_backup()
except Exception as error:
    report_to_alert51("failure", started, str(error))
    raise
report_to_alert51("success", started)

In CI, send the check-in from a step that always runs (GitLab after_script with $CI_JOB_STATUS, GitHub Actions if: always() with job.status) and end the command with || true so reporting never changes the pipeline result.

SDKs

Alert51 has SDKs for Node.js, Java, PHP, Python and Go, but they are not published to npm, Maven Central, Packagist, PyPI or the Go module proxy yet, so there is no install command that works outside the Alert51 source repository. Use plain HTTP as shown above. If the project already contains an Alert51 SDK, use it; its usage is described at https://alert51.com/docs#sdks.

Responses

201 Created means this check-in created the monitor. 200 OK means it was recorded for an existing monitor. Both return the same JSON:

json
{
  "monitorId": "0b7f3c52-6f1e-4c55-9a1d-3b8c2e9d4f10",
  "project": "production",
  "job": "db-backup",
  "created": true,
  "checkIn": {
    "id": "c6a1e0d4-2b9f-4c1a-8e57-91f0a3d2b6e8",
    "status": "success",
    "receivedAt": "2026-11-23T03:07:12.000Z",
    "slotAt": "2026-11-23T03:00:00.000Z",
    "outcome": "applied",
    "late": false
  },
  "schedule": { "cron": "0 3 * * *", "timezone": "UTC", "graceSeconds": 1800, "changed": false },
  "monitorStatus": "up",
  "nextRunAt": "2026-11-24T03:00:00.000Z",
  "deadlineAt": "2026-11-24T03:30:00.000Z",
  "incident": null
}
  • checkIn.outcome is applied, stale (older than the latest applied report) or paused (the monitor is paused in the dashboard).
  • checkIn.late is true when the check-in arrived after its slot's grace period.
  • monitorStatus is up, down or paused; incident describes the open incident, if any.

Errors

Errors are JSON with a stable code: { "error": { "code": "...", "message": "...", "details": ... }, "requestId": "..." }. Log the status, code and requestId, never the token.

  • 400 validation_failed: the body or the Idempotency-Key header is invalid. details lists { "path", "message" } per field. Fix the payload; do not retry.
  • 401 unauthorized: the token is missing, invalid or revoked. Do not retry; ask the user to check ALERT51_TOKEN.
  • 403 quota_exceeded: the account's plan limit for monitors or projects is reached. Do not retry; ask the user to remove a monitor or upgrade.
  • 409 idempotency_key_reuse: the Idempotency-Key was already used with a different body.
  • 413 payload_too_large: the body is larger than 16 KB.
  • 422 cron_required, invalid_cron, invalid_timezone, scheduled_at_out_of_range: the schedule fields are wrong. Fix them; do not retry.
  • 429 rate_limited: too many requests. The API allows 3 requests per second per token, and the edge may also limit by client IP. Wait the number of seconds in the Retry-After header (the API also returns it as error.details.retryAfterSeconds); a 429 from the edge may not have a JSON body.
  • 5xx, timeouts and network errors are temporary. Retry at most once or twice with a short backoff and the same Idempotency-Key, within the job's own time budget, and then give up and log. Never block or fail the job because Alert51 is unreachable.

Idempotency

Send an Idempotency-Key header (1 to 255 visible ASCII characters) to make retries safe. The same key with the same body within 24 hours returns the original response with the header Idempotent-Replayed: true and records nothing new. The same key with a different body returns 409 idempotency_key_reuse. Build the key from something unique per run, such as the job name plus the scheduled time or the CI run ID, for example db-backup-2026-11-23T03:00Z.

Verification checklist

Use a dedicated test job (for example project staging or job db-backup-test) and a test token, a test notification destination, or a local Alert51 instance, so simulated failures do not page anyone.

  1. Send the first check-in with cron, timezone and graceSeconds. Expect 201 and "created": true.
  2. Check that schedule echoes the intended values and that nextRunAt and deadlineAt match the job's next scheduled time and that time plus the grace period. A check-in sent by hand outside the scheduled window is matched to the previous scheduled time and reported with "late": true; that is expected for a manual test.
  3. Send a later check-in without cron. Expect 200 and "created": false.
  4. Simulate a failure (make the test job exit non-zero or raise). Expect a failure check-in, an open incident in the response, and the job's original exit code or exception unchanged.
  5. Send a check-in with an invalid token. Expect 401, and confirm the job still finishes with its own result.
  6. Point ALERT51_URL at an unreachable address and confirm the job ends within the timeout with its own result.
  7. Delete or pause the test monitor in the dashboard when done, and confirm the real job's monitor appears after its first real run.

Authentication

Every developer API request carries an API token in the Authorization header:

Header
Authorization: Bearer a51_xxxxxxxx_your-secret
  • Tokens belong to your account, not to a project. One token can report any project and any job.
  • Create several named tokens, for example one per developer, server or deployment, so you can revoke one without touching the others.
  • The secret is shown once, when you create the token. Alert51 stores only a hash; the dashboard shows the prefix to tell tokens apart.
  • Revoked tokens stop working immediately and get 401 unauthorized.
  • Each token shows when it was last used, which helps find tokens nobody needs.

Keep tokens in a secret store or CI variable, never in the repository.

Token management

Manage tokens in the dashboard on the API tokens page. Creating a token requires a verified email address. The number of tokens is limited by your plan.

  • Create: give the token a name that says where it lives, such as backup-server-1 or gitlab-ci.
  • Rotate: create a new token, deploy it, check that the old token’s last-used time stops moving, then revoke the old one.
  • Revoke: takes effect immediately. Revoked tokens stay in the list for reference.

SDKs

Small clients for Node.js, Java, PHP, Python and Go wrap POST /v1/check-ins: configure the API token once and report a run with one call. Each SDK sends the token as a Bearer header, uses a 10 second timeout by default, makes one attempt per call, and never puts the token in errors or logs. success and failure are shortcuts over the same check-in call, which also accepts graceSeconds, scheduledAt, name, durationMs and an idempotency key.

The first check-in for a job must include cron: it creates the project and monitor. Later check-ins can omit the schedule. Errors expose the HTTP status and the API error code, for example 401 unauthorized or 429 rate_limited with the retry delay.

Node.js 18+, built-in fetch, TypeScript declarations included, no runtime dependencies. Source: sdks/node (npm package @alert51/sdk). baseUrl defaults to https://api.alert51.com/v1. For a self-hosted origin use https://your-host/api/v1.

Install from the repository

Node.js install
npm --prefix sdks/node install && npm --prefix sdks/node run build
npm install ./path/to/alert51/sdks/node

Configure

Set ALERT51_TOKEN where the job runs; keep the token out of code and logs.

Client
import { Alert51Client } from '@alert51/sdk';

const alert51 = new Alert51Client({
  token: process.env.ALERT51_TOKEN,
  timeoutMs: 10_000,
});

Report success

First check-in with a schedule
await alert51.success({
  project: 'production',
  job: 'db-backup',
  cron: '0 3 * * *',
  timezone: 'Europe/Moscow',
});

Report failure

Failure for an existing monitor
await alert51.failure({
  project: 'production',
  job: 'db-backup',
  message: 'pg_dump exited with code 1',
});

Report a backup's real outcome

Reports success or failure from the backup result. If reporting the failure also fails, the original backup error is still raised, so the job keeps its own exit status.

Backup job
const started = Date.now();
try {
  await runBackup();
} catch (jobError) {
  await alert51
    .failure({ project: 'production', job: 'db-backup', message: String(jobError), durationMs: Date.now() - started })
    .catch((reportError) => console.error('Alert51 failure report was not delivered:', reportError.message));
  throw jobError;
}
await alert51.success({ project: 'production', job: 'db-backup', cron: '0 3 * * *', durationMs: Date.now() - started });

Handle errors

API and timeout errors
import { Alert51ApiError, Alert51TimeoutError } from '@alert51/sdk';

try {
  await alert51.success({ project: 'production', job: 'db-backup' });
} catch (error) {
  if (error instanceof Alert51ApiError) console.error(error.status, error.code, error.requestId, error.retryAfterSeconds);
  if (error instanceof Alert51TimeoutError) console.error('Timed out after', error.timeoutMs, 'ms');
}

Check-in request

POST /v1/check-ins with a JSON body up to 16 KB. Send one per run, when the run finishes.

Check-in fields
FieldRequiredDescription
projectYesProject slug. Created on first use if your plan allows another project. Pattern ^[a-z0-9][a-z0-9_.-]{0,62}$.
jobYesJob slug, unique within the project. Same pattern as project.
statusYessuccess or failure. A failure opens an incident right away.
cronFirst check-inStandard 5-field cron expression of the job’s schedule. Required when the monitor does not exist yet; optional afterwards.
timezoneNoIANA time zone the cron expression runs in, such as Europe/Moscow. Default UTC.
graceSecondsNoHow long after the scheduled time to wait before the run counts as missed. Default 300, maximum 604800 (7 days).
scheduledAtNoISO-8601 time the run was scheduled for. Gives exact slot attribution for slow or retried runs. Up to 5 minutes in the future and 7 days in the past.
nameNoHuman-readable monitor name shown in the dashboard and alerts.
messageNoUp to 1000 characters, such as the last error line or a pipeline URL. Included in alerts.
durationMsNoHow long the run took, in milliseconds. Shown in check-in history.

Response

A successful request returns the stored check-in, the schedule now in effect, the next run, the deadline and any open incident. checkIn.outcome is applied, stale or paused.

Response body
{
  "monitorId": "0b7f3c52-6f1e-4c55-9a1d-3b8c2e9d4f10",
  "project": "production",
  "job": "db-backup",
  "created": true,
  "checkIn": {
    "id": "c6a1e0d4-2b9f-4c1a-8e57-91f0a3d2b6e8",
    "status": "success",
    "receivedAt": "2026-11-22T21:07:12.000Z",
    "slotAt": "2026-11-22T21:00:00.000Z",
    "outcome": "applied",
    "late": false
  },
  "schedule": {
    "cron": "0 */12 * * *",
    "timezone": "Europe/Moscow",
    "graceSeconds": 900,
    "changed": true
  },
  "monitorStatus": "up",
  "nextRunAt": "2026-11-23T09:00:00.000Z",
  "deadlineAt": "2026-11-23T09:15:00.000Z",
  "incident": null
}

Schedules and timing

  • Monitoring starts with the first check-in. Before that, Alert51 does not know the job exists and cannot miss it.
  • Slot. Each check-in is attributed to a slot: the latest cron fire time at or before (scheduledAt ?? received time) + 60 s, in the monitor’s time zone. The 60 seconds cover jobs that report a moment before their scheduled time.
  • Next run is the next cron fire time after the slot. Deadline is next run plus the grace period.

Example: 0 */12 * * * with 900 s grace. The midnight run reports at 00:07. Its slot is 00:00, the next run is due at 12:00, and if nothing arrives Alert51 opens a missed incident at 12:15.

Late, stale and changed reports

  • Late reports are accepted. A success after the deadline resolves the open incident.
  • A report with an earlier effective time than the latest applied one is recorded as stale. It shows in history but never changes the monitor state, the schedule or incidents.
  • Sending a different cron, timezone or graceSeconds updates the schedule from that check-in. Leaving them out keeps the stored schedule.
  • Daylight saving time is handled through IANA time zones, so the schedule follows local wall-clock time.
  • A missed deadline opens one incident per outage, not one per missed slot. Check-ins to a paused monitor are recorded as paused.

Idempotency

Retrying a check-in after a timeout is safe when you send an Idempotency-Key header (up to 255 characters). Keys are remembered for 24 hours.

  • Same key, same body: you get the original response with the header Idempotent-Replayed: true. Nothing is recorded twice.
  • Same key, different body: 409 idempotency_key_reuse.
Retry-safe check-in
curl --fail-with-body --silent --show-error --max-time 10 \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: db-backup-$(date -u +%Y%m%dT%H)" \
  -d '{"project":"production","job":"db-backup","status":"success"}' \
  "$ALERT51_URL/v1/check-ins"

Errors

Errors return JSON: { "error": { "code", "message", "details" }, "requestId" }. Branch on code; quote requestId when you contact support.

Error codes
StatusCodeWhat to do
400validation_failedA field is missing or malformed. details lists the fields.
401unauthorizedMissing, malformed or revoked token. Check the Authorization header.
403email_not_verifiedVerify the account email address, then retry.
403quota_exceededA plan limit was reached, such as active monitors or projects. Upgrade or remove unused ones.
403plan_feature_unavailableThe feature is not part of your plan.
404not_foundThe project, monitor or resource does not exist for this account.
409idempotency_key_reuseThe Idempotency-Key was already used with a different body. Use a new key.
413—The body is over 16 KB. Shorten the message.
422cron_requiredFirst check-in for this job: include cron.
422invalid_cronThe cron expression is not a valid 5-field expression.
422invalid_timezoneUse an IANA name such as Europe/Berlin.
422scheduled_at_out_of_rangescheduledAt must be at most 5 minutes ahead and 7 days back.
429rate_limitedToo many requests: the public API allows 3 per second per token. Wait the Retry-After seconds (also in error.details.retryAfterSeconds), then retry.

Read endpoints

Use the same Bearer token to read monitoring state, for example from a status page or a deployment check. {project} and {job} are slugs.

  • GET /v1/projects
  • GET /v1/projects/{project}/monitors
  • GET /v1/projects/{project}/monitors/{job}
  • GET /v1/projects/{project}/check-ins?job&status&since&until&limit&cursor
  • GET /v1/projects/{project}/incidents?job&status&since&until&limit&cursor

Lists are paginated with a cursor. limit defaults to 50, maximum 200. Pass nextCursor as cursor until it is null. since and until take ISO-8601 times.

List response
{
  "data": [
    "…"
  ],
  "nextCursor": "eyJpZCI6IjEyMyJ9"
}
Read a monitor and its failures
curl -sS -H "Authorization: Bearer $ALERT51_TOKEN" \
  "$ALERT51_URL/v1/projects/production/monitors/db-backup"

curl -sS -H "Authorization: Bearer $ALERT51_TOKEN" \
  "$ALERT51_URL/v1/projects/production/check-ins?job=db-backup&status=failure&limit=20"

The full schema is in the OpenAPI spec.

Plan limits

A check-in that would create a monitor or project over your plan’s limit is rejected with 403 quota_exceeded; existing monitors keep working. See Pricing for prices.

Limits by plan
LimitFreeStartupBasicProMax
Active monitors31550250500
Projects1371030
API tokens25102050
Check-in history7 days30 days60 days90 days365 days
Alert channelsEmail, TelegramEmail, Telegram, WebhookEmail, Telegram, WebhookEmail, Telegram, WebhookEmail, Telegram, Webhook
Webhook destinationsNot included241030

Notifications

Alert51 notifies every enabled channel when an incident opens and when it resolves. Configure channels on the Notifications page.

  • Email goes to your account address and is turned on when you verify it.
  • Telegram: generate a link code, send /start CODE to the Alert51 bot, and the chat is linked.
  • Webhooks (Startup and above) send signed JSON to an HTTPS endpoint.

Failed deliveries retry after 5 s, 30 s, 2 min and 10 min. After 5 attempts the delivery is marked failed and the error is shown in the dashboard. Use the Test button on a channel to check it end to end.

Scheduled reports send a daily or weekly summary of every job in scope (all jobs, chosen projects including jobs added later, or a list of jobs) to Email or Telegram, at a local time in your profile time zone (18:00 by default). Each job shows 🟢 OK, 🔴 Failed or Missed, or 🟡 Paused or No check-in yet, with failures that happened during the period. Long Telegram reports are split into numbered messages.

Webhook signatures

Each webhook is a POST with a JSON body and three headers:

  • Alert51-Event-Id: unique event id. Delivery is at least once, so dedupe on it.
  • Alert51-Timestamp: Unix time in seconds when the delivery was signed.
  • Alert51-Signature: v1=<hex>, where hex is HMAC-SHA256 with the signing secret string (whsec_…) as key and ${timestamp}.${rawBody} as message.

Event types: incident.opened, incident.resolved and channel.test.

Body of incident.opened
{
  "id": "5d0f8f5e-8c1b-4f7e-a3a4-2f0b6c9e1d77",
  "type": "incident.opened",
  "createdAt": "2026-11-23T09:15:04.000Z",
  "data": {
    "incident": {
      "id": "9e2b7a10-4d3c-4b8e-b1f6-6a5d0c3e2f19",
      "cause": "missed",
      "status": "open",
      "openedAt": "2026-11-23T09:15:04.000Z",
      "resolvedAt": null,
      "slotAt": "2026-11-23T09:00:00.000Z"
    },
    "monitor": {
      "id": "0b7f3c52-6f1e-4c55-9a1d-3b8c2e9d4f10",
      "name": "db-backup",
      "job": "db-backup",
      "project": "production",
      "projectName": "Production",
      "cron": "0 */12 * * *",
      "timezone": "Europe/Moscow"
    },
    "checkIn": null,
    "dashboardUrl": "https://alert51.com/app/incidents/9e2b7a10-4d3c-4b8e-b1f6-6a5d0c3e2f19"
  }
}

Verifying

  • Compute the HMAC over the raw body bytes, before any JSON parsing, and compare in constant time.
  • Reject timestamps older than 5 minutes.
  • Respond with 2xx within 10 seconds; do slow work in the background.
  • Redirects are not followed, and only HTTPS endpoints on public addresses are accepted.
  • If the secret leaks, rotate it from the dashboard and update your receiver.
Node.js (Express) receiver
import { createHmac, timingSafeEqual } from 'node:crypto';
import express from 'express';

const signingSecret = process.env.ALERT51_WEBHOOK_SECRET;
const toleranceSeconds = 300;
const app = express();

function isValidSignature(timestamp, rawBody, header) {
  const expected = createHmac('sha256', signingSecret).update(`${timestamp}.${rawBody}`).digest();
  const received = Buffer.from(header.startsWith('v1=') ? header.slice(3) : '', 'hex');
  return received.length === expected.length && timingSafeEqual(received, expected);
}

app.post('/hooks/alert51', express.raw({ type: 'application/json', limit: '256kb' }), async (req, res) => {
  const eventId = req.get('Alert51-Event-Id');
  const timestamp = req.get('Alert51-Timestamp') ?? '';
  const signature = req.get('Alert51-Signature') ?? '';
  const rawBody = req.body.toString('utf8');

  const age = Math.abs(Date.now() / 1000 - Number(timestamp));
  if (!Number.isFinite(age) || age > toleranceSeconds) return res.status(400).send('Timestamp outside tolerance');
  if (!isValidSignature(timestamp, rawBody, signature)) return res.status(401).send('Invalid signature');

  if (await alreadyProcessed(eventId)) return res.sendStatus(200);
  const event = JSON.parse(rawBody);
  await enqueue(event);
  res.sendStatus(204);
});

Examples

Report a failure

After the first check-in the schedule is stored, so later requests can omit cron.

Failure with message
curl --fail-with-body --silent --show-error --max-time 10 \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "project": "production",
    "job": "db-backup",
    "status": "failure",
    "message": "pg_dump: connection refused",
    "durationMs": 4210
  }' \
  "$ALERT51_URL/v1/check-ins"

crontab

Reports success or failure based on the script’s exit code.

crontab -e
SHELL=/bin/bash
ALERT51_URL=https://api.alert51.com
ALERT51_TOKEN=a51_xxxxxxxx_your-secret

0 */12 * * * if /opt/scripts/backup.sh; then s=success; else s=failure; fi; curl -fsS --max-time 10 -H "Authorization: Bearer $ALERT51_TOKEN" -H 'Content-Type: application/json' -d "{\"project\":\"production\",\"job\":\"db-backup\",\"status\":\"$s\",\"cron\":\"0 */12 * * *\",\"timezone\":\"Europe/Moscow\",\"graceSeconds\":900}" "$ALERT51_URL/v1/check-ins"

NestJS

A scheduled service with @nestjs/schedule that reports each run, including failures, without letting reporting errors break the job.

database-backup.job.ts
import { Injectable, Logger } from '@nestjs/common';
import { Cron } from '@nestjs/schedule';

type TCheckInStatus = 'success' | 'failure';

@Injectable()
export class DatabaseBackupJob {
  private readonly logger = new Logger(DatabaseBackupJob.name);

  @Cron('0 */12 * * *', { timeZone: 'Europe/Moscow' })
  public async run(): Promise<void> {
    const startedAt = Date.now();
    try {
      await this.backup();
      await this.report('success', startedAt);
    } catch (error) {
      await this.report('failure', startedAt, error instanceof Error ? error.message : String(error));
      throw error;
    }
  }

  private async backup(): Promise<void> {
    await Promise.resolve();
  }

  private async report(status: TCheckInStatus, startedAt: number, message?: string): Promise<void> {
    try {
      const response = await fetch(`${process.env.ALERT51_URL}/v1/check-ins`, {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${process.env.ALERT51_TOKEN}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          project: 'production',
          job: 'db-backup',
          status,
          cron: '0 */12 * * *',
          timezone: 'Europe/Moscow',
          graceSeconds: 900,
          durationMs: Date.now() - startedAt,
          message: message?.slice(0, 1000),
        }),
        signal: AbortSignal.timeout(10_000),
      });
      if (!response.ok) this.logger.warn(`Alert51 check-in rejected: ${response.status} ${await response.text()}`);
    } catch (error) {
      this.logger.warn(`Alert51 check-in failed: ${String(error)}`);
    }
  }
}

Node.js fetch

A standalone worker script that reports success or failure with the built-in fetch. Reporting errors are logged and never fail the job; a job failure sets a non-zero exit code. Schedule: runs every 15 minutes: */15 * * * *.

invoice-sync.mjs
import { syncInvoices } from './jobs/sync-invoices.mjs';

const startedAt = Date.now();

async function checkIn(status, message) {
  try {
    const response = await fetch(`${process.env.ALERT51_URL}/v1/check-ins`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.ALERT51_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        project: 'production',
        job: 'invoice-sync',
        status,
        cron: '*/15 * * * *',
        timezone: 'UTC',
        graceSeconds: 300,
        durationMs: Date.now() - startedAt,
        message: message?.slice(0, 1000),
      }),
      signal: AbortSignal.timeout(10_000),
    });
    if (!response.ok) console.error(`Alert51 check-in rejected: ${response.status} ${await response.text()}`);
  } catch (error) {
    console.error(`Alert51 check-in failed: ${error}`);
  }
}

try {
  await syncInvoices();
  await checkIn('success');
} catch (error) {
  await checkIn('failure', error instanceof Error ? error.message : String(error));
  process.exitCode = 1;
}

GitLab CI

after_script runs even when the job fails, and CI_JOB_STATUS tells which way it went. The job keeps its own exit status. Set the cron in the check-in to the pipeline schedule: pipeline schedule: 30 2 * * * (UTC).

.gitlab-ci.yml
nightly-e2e:
  image: node:22
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  script:
    - npm ci
    - npm run test:e2e
  after_script:
    - |
      if [ "$CI_JOB_STATUS" = "success" ]; then STATUS=success; else STATUS=failure; fi
      curl --fail-with-body --silent --show-error --max-time 10 \
        -H "Authorization: Bearer $ALERT51_TOKEN" \
        -H 'Content-Type: application/json' \
        -d "{\"project\":\"production\",\"job\":\"nightly-e2e\",\"status\":\"$STATUS\",\"cron\":\"30 2 * * *\",\"timezone\":\"UTC\",\"graceSeconds\":3600,\"message\":\"$CI_PIPELINE_URL\"}" \
        "$ALERT51_URL/v1/check-ins" || true

Backup script

Reports the pg_dump result either way and exits with the backup status. Walkthrough: backup job monitoring.

backup.sh
#!/bin/sh
set -u
started=$(date +%s)
if pg_dump --format=custom --file=/var/backups/app.dump "$DATABASE_URL"; then
  status=success
else
  status=failure
fi
duration_ms=$(( ($(date +%s) - started) * 1000 ))

curl --fail-with-body --silent --show-error --max-time 10 \
  -H "Authorization: Bearer $ALERT51_TOKEN" \
  -H 'Content-Type: application/json' \
  -d "{\"project\":\"production\",\"job\":\"db-backup\",\"status\":\"$status\",\"cron\":\"0 3 * * *\",\"timezone\":\"UTC\",\"graceSeconds\":1800,\"durationMs\":$duration_ms}" \
  "$ALERT51_URL/v1/check-ins"

[ "$status" = success ]

Confirm it’s you

Security changes need a sign-in from the last 10 minutes. Confirm once and the change continues automatically.