How do I get notified when an API goes down?
Run a bash healthcheck on cron that POSTs to Lert when the status is bad. Download the app, copy your link, and let a scheduled curl buzz your phone the moment an endpoint fails. No account, no API keys, no SDK.
The simplest uptime monitor is a curl on a timer. You hit the endpoint, check the status code, and if it's not what you expect, you send yourself a push. Because your Lert link is the credential, the alerting half takes one line — no dashboard, no monitoring service, no API key to store on the box.
The entire setup — under 30 seconds
- Download the app. Open it once. There's no account to create, and your private link is waiting on screen.
- Copy your link. One tap copies something like
https://lert.dev/p/your-id. - Add the healthcheck to cron. Curl the endpoint every minute; POST to your link if the status isn't 200.
Then your phone buzzes — instantly, even locked in your pocket.
The healthcheck script
#!/usr/bin/env bash URL="https://api.example.com/health" LERT="https://lert.dev/p/your-id" code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$URL") if [ "$code" != "200" ]; then curl -s -X POST "$LERT" \ -H "Content-Type: application/json" \ -d "{\"title\":\"API down\",\"body\":\"$URL returned $code\",\"tag\":\"uptime\"}" fi
Schedule it in crontab with * * * * * /path/to/check.sh to run every minute. A timeout or connection refusal makes curl return a non-200 code too, so a hard outage triggers the same alert. Add a flag file if you'd rather be pinged once per outage instead of every minute.
Tip: point the same pattern at your own site, a webhook receiver, or a database health endpoint. Any check you can express in a shell script can end with a single POST to Lert.
Related things people automate
- Get notified when disk space is low
- Send yourself a reminder from a script
- The easiest way to notify from anywhere
- Uptime notifications
- Server monitoring notifications
It's free for one channel and 50 notifications a day; Lert Pro is $2.99/month for unlimited. See the docs for the full API, or the answers index for more recipes.
Send your first one in 30 seconds.
Download Lert, copy your link, POST to it. Your phone buzzes.