Quickstart

Send your first heartbeat.

A single HTTP request tells PingCron your scheduled job finished. Start with a completion check-in, then add runtime details or an alert destination.

  1. Create a monitor. Choose a name, expected schedule and grace period. Copy its private ping URL into a scheduler secret named PINGCRON_PING_URL.
  2. Report after success. Replace the script below with your workload. The shell runs curl only when the command exits successfully.
Completion heartbeat · sh
./nightly-backup.sh && curl -fsS --max-time 10 "$PINGCRON_PING_URL"
  1. Verify the receipt. Run the job and open its monitor. Find the successful check-in in history, then test a saved notification destination in Settings.
Create a monitor

Heartbeat endpoints

Send signals to https://api.pingcron.io. The slug in your ping URL is a secret. Keep it in the scheduler’s environment and use the dashboard UUID only for management operations.

MethodEndpointSignal
GET, POST, HEAD/ping/{slug}Record success
GET, POST/ping/{slug}/startRecord a start
GET, POST/ping/{slug}/failReport failure
POST/api/ping/{slug}Send a structured report

Send a start before work and a success or failure at the end to measure elapsed time. A start alone leaves the run open until a terminal signal or deadline.

Runtime payloads

Use the structured endpoint to include an exit code, duration in milliseconds, host and stderr. Set PINGCRON_SLUG to the secret slug of a test monitor before trying this failure example.

Report a failed run · sh
curl -fsS --max-time 10 \
  -H "Content-Type: application/json" \
  --data '{"status":"fail","exit_code":2,"duration_ms":4300,"host":"backup-01","stderr":"volume unavailable"}' \
  "https://api.pingcron.io/api/ping/${PINGCRON_SLUG}"

Use start, success or fail for the status. A nonzero exit code signals failure. Keep secrets out of stderr. PingCron retains the tail that fits alongside the host in a 4,096-byte telemetry record.

Connect an MCP client

Open AI Agents in your dashboard and confirm the remote MCP URL. For Codex, add the server and authorize read access through your browser.

Connect Codex · sh
codex mcp add pingcron --url https://api.pingcron.io/mcp
codex mcp login pingcron --oauth-client-registration dcr \
  --scopes account:read,monitors:read,history:read,incidents:read

Review the scopes on the consent screen. Start a fresh conversation and ask, “Which monitors missed a check-in in the last 24 hours?” The assistant can inspect retained evidence within the workspace you authorized.

Setup for other MCP clients

Wrap a command with the CLI

With the PingCron CLI installed and PINGCRON_PING_URL set, put pingcron run -- before your existing executable. The wrapper preserves the child’s exit code and reports the measured duration, host and available failure output.

Wrap a database backup · sh
pingcron run -- pg_dump --file=nightly.dump my_database

The CLI requires Node.js 22.13 or later. From the repository’s packages/cli directory, run npm pack, then install the resulting tarball on your runner.

Receive webhook events

On Pro, Team or Business, save your HTTPS destination in Settings under Notifications. Send a test and check your receiver. Down and recovery events include the monitor, schedule and evidence recorded at the transition.

Down event · selected JSON fields
{
  "event": "down",
  "event_id": "1fae486e-3f80-45f7-910f-bab192665078",
  "name": "nightly-backup",
  "status": "down",
  "schedule": "0 2 * * *",
  "grace_period": 300,
  "evidence": {
    "reason": "expected_receipt_missing",
    "nominal_expected_at": "2026-11-20T02:00:00Z",
    "effective_deadline_at": "2026-11-20T02:05:00Z"
  }
}
View a recovery payload
Recovery event · selected JSON fields
{
  "event": "up",
  "event_id": "70211aa2-88bb-441c-a9c7-bcf55d30f82f",
  "name": "nightly-backup",
  "status": "up",
  "last_ping": "2026-11-20T02:14:00Z",
  "last_ping_status": "success",
  "evidence": {
    "reason": "recovered",
    "event_at": "2026-11-20T02:14:00Z"
  }
}

Use event_id to deduplicate repeat deliveries. The evidence.reason field identifies what PingCron observed. Consult your scheduler logs and job output to investigate the cause.