247Monitor

How to monitor an API for downtime

Monitor an API for downtime by checking a short list of endpoints the way a real client calls them: authenticated, from several regions, with assertions on the body and latency, and alerts that only fire on confirmed failures.

The 247Monitor Team

Reviewed by the product and engineering team. How we review content

10 min read

If you want the concepts first, start with what API monitoring is. This is the practical half: which endpoints earn a monitor, how to authenticate without leaking secrets, what to assert beyond a status code, and how to tune the whole thing so an alert at 3am is never a false one.

Key takeaways

  • API downtime is three failures, not one: hard errors, wrong answers wearing a 200, and slowness. Monitor for all three.
  • Four endpoints cover most APIs: health, a real read, token issuance and an authenticated read.
  • Give monitors a dedicated read-only credential (bearer or header auth), never a personal or admin token.
  • Assert on the body and latency, not just the code. Slow is degraded, not down; alert them differently.
  • Kill false alarms with multi-region confirmation and consecutive-failure rules, then rehearse the alert once.

What counts as API downtime

For a website, down usually means an error page. An API fails in three distinct ways, and a monitor that only understands one of them will happily sleep through the other two:

  • Hard failures. Connection refused, timeouts, 5xx responses. The easy case; any HTTP check catches these.
  • Wrong answers. The endpoint returns 200 OK with an empty array, an error object, or a schema your clients can't parse. To every naive check the API is up; to every consumer it is down.
  • Slowness. A payments endpoint answering in nine seconds is technically responding and practically broken, because client timeouts upstream of you are already firing.

“Monitoring an API for downtime” therefore means three assertions per check: it answers, it answers correctly, and it answers in time. Everything below builds towards that.

Choose the endpoints to watch

The most common mistake is monitoring either one endpoint or all of them. One endpoint (usually /health) proves the process is alive while the business logic burns; all of them buries the signal in noise and doubles your traffic. A shortlist beats both:

api.example.com · watchlist4 checks
  • GET/health

    The API's own self-check: process up, database and queue reachable.

  • GET/v1/products

    A real, read-only business query. Proves data actually comes back.

  • POST/v1/auth/token

    Mints a token. If this fails, every client is locked out.

  • GET/v1/ordersbearer token

    An authenticated read. Proves tokens issued above are honoured.

  • Everything else: not monitored directly. If these four are healthy, the rest is a bug report, not an outage.

Four checks cover the stack: liveness, real reads, auth issuance and authenticated access. Placeholder API; adapt the paths to yours.

The health endpoint deserves one extra note, because monitoring amplifies whatever it tells you. A good one is fast, needs no auth, and reports on its dependencies honestly:

GET /health  →  200 · application/json
{
  "status": "ok",
  "checks": { "database": "ok", "cache": "ok", "queue": "ok" },
  "version": "1.42.3"
}

If /health returns 200 even when the database is unreachable, your monitoring inherits the lie. Have it check the things the API cannot live without, and assert on the body (the "status":"ok"), not just the code.

Build the check, step by step

  1. 1

    Create an HTTP monitor for the health endpoint

    In the new-monitor dialog, choose the HTTP type and point it at https://api.example.com/health. This is your baseline liveness check; the interesting ones come next.

  2. 2

    Call it like a real client

    Match the request your consumers actually send: the right method, an Accept: application/json header, and a request body where an endpoint expects one. The closer the check is to real traffic, the fewer failures can hide between them.

  3. 3

    Add auth without leaking secrets

    For protected endpoints, use the monitor's authentication options: a bearer token, a custom header (for API keys), or basic auth. Mint a dedicated, read-only credential for monitoring with the narrowest scope you can, so the token in your monitoring tool is never one worth stealing.

  4. 4

    Write the assertions

    Set the expected status codes, a body assertion and a response-time ceiling per endpoint; the next section covers each. This is the difference between checking the API and checking that it merely exists.

  5. 5

    Pick the interval and timeout

    Check the shortlist every 30 to 60 seconds (paid plans go to 30 seconds) and secondary endpoints every few minutes. Keep the request timeout below the interval, and generous enough that a slow-but-alive response registers as degraded rather than a timeout.

  6. 6

    Route the alerts, then rehearse once

    Send hard failures to the channel that wakes someone (Slack, Teams, Telegram, Discord, email, SMS or a webhook) and degraded to a quieter one. Then force a failure safely: temporarily set an expected status the endpoint never returns, watch the alert arrive, and put it back. Never trust an alert path you haven't seen fire.

Assert more than a status code

A single API check can verify the whole shape of a response. Here is one with all three assertion layers on:

check · api.example.com · every 60s

Request

GET /v1/products/42

Authorization: Bearer ••••••••

Accept: application/json

Response · what we assert

  • Status code200 OK
  • Response time142 ms · budget 500 ms
  • Content-Typeapplication/json
  • Body · $.status“available”
  • Schema8 / 8 fields present
VERDICT: HEALTHY. Every assertion passed. The endpoint is reachable, quick, and returning the exact shape of data a caller expects.
An API check is a request, plus a set of assertions about the response.
  • Expected status codes. List exactly what healthy looks like (200, or 200, 204). Don't accept “any 2xx” when the endpoint has precisely one correct answer, and remember a redirect can mask a broken route.
  • Body assertions. Require text to be present ("status":"ok") or absent ("error"). For JSON APIs you can match a specific field with a JSONPath expression, or use a regex where the shape varies. This is what catches the 200-that-lies, the trap the API explainer covers in detail.
  • A response-time ceiling. Set a maximum in milliseconds based on what your clients tolerate. Cross it and the monitor turns degraded with the measured time in the message, so a developing slowdown is visible days before it becomes an outage.

Tune out the false alarms

An API monitor you mute is worse than none, and muting always starts with false alarms. Three settings keep the signal clean:

check · example.com · 5 regions

  • London200 OK · 142 ms
  • Frankfurt200 OK · 151 ms
  • New York503 · request failed
  • Singapore200 OK · 168 ms
  • São Paulo200 OK · 180 ms
VERDICT: HEALTHY. 4 of 5 regions returned 200 OK. The lone New York failure was re-checked from a second region, confirmed transient, and no alert was sent.
One failing region isn't an outage. Confirming from a second location is what kills false alarms.
  • Confirm from a second region. The internet between one probe and your API fails far more often than your API. A blip seen from one location is re-checked from another before it counts; paid plans check from multiple regions worldwide, so a single flaky path never pages you.
  • Require consecutive failures. By default an incident opens after consecutive failed checks, not one. At a 30-second interval that still means alerting within about a minute of a real outage, with almost no one-off noise.
  • Separate slow from down. Degraded latency goes to a channel the team reads in the morning; hard failures go to the one that buzzes. If every alert sounds the same, every alert gets the same shrug.

Cover the sequence, not just the endpoints

Clients don't call endpoints in isolation; they log in, create things and read them back. The shortlist already covers the most important sequence (a token is minted, then honoured) as two independent checks. When a flow has to carry state through several calls, chain them into one journey:

journey · api.example.com · checkout

  1. 1

    POST /auth/login

    200 · capture access token

  2. 2

    POST /v1/orders

    201 · capture orderId

  3. 3

    GET /v1/orders/{orderId}

    200 · assert status = “created”

  4. 4

    DELETE /v1/orders/{orderId}

    204 · clean up test data

VERDICT: HEALTHY. The whole workflow ran end to end. The token from step 1 unlocked step 2, and the order it created was readable, then cleaned up.
Real users don't hit one endpoint. Monitor the chain, not just a single call.

Where a real browser is involved (a login form, a redirect dance), drive it with a browser journey instead; for pure JSON flows, chained HTTP checks stay lighter and faster. And two adjacent failures deserve their own monitors while you're here: the certificate on api.example.com expiring quietly (SSL expiry monitoring) and the scheduled jobs that consume your API or deliver your webhooks (heartbeat checks).

TipTreat your API's public uptime as a product feature: wire the API component into your status page so consumers see confirmed incidents and recoveries without emailing you. The check you built above is the same one that keeps that page honest.

Frequently asked questions

How do I monitor an API for downtime?

Pick a handful of representative endpoints (a health check, a real read, token issuance and an authenticated read), create an HTTP monitor for each that calls it like a real client would, assert on the status code, the response body and a response-time ceiling, check from more than one region, and route confirmed failures to the channels your team actually watches.

Which API endpoints should I monitor?

Not all of them. Monitor the health endpoint, one real read-only business query, the endpoint that issues tokens, and one authenticated read that uses them. Together those cover liveness, data, and both halves of auth. If all four are healthy, a broken route elsewhere is a bug report rather than an outage.

How do I monitor an API that requires authentication?

Use the monitor's auth options: a bearer token, a custom header such as an API key, or basic auth. Create a dedicated read-only credential for monitoring with the narrowest scope your API supports, and never reuse a personal or admin token; the monitor only needs enough access to prove the endpoint answers.

How often should I check an API?

Every 30 to 60 seconds for the endpoints that matter; five-minute intervals are fine for secondary surfaces. Frequency alone doesn't create noise if failures are confirmed from a second region and an incident requires consecutive failed checks before anyone is alerted.

Can I monitor an API for free?

Yes. 247Monitor's free plan includes 25 monitors with HTTP and keyword checks from one location at 60-second intervals, plus six non-SMS alert integrations. Paid plans add multi-region checking and 30-second intervals.

Four endpoints, three assertions each, confirmed from more than one region: that's API downtime monitoring that catches hard failures, wrong answers and slowdowns alike. 247Monitor's HTTP and API checks support all of the above on every plan, with 25 monitors free and no card required.

No credit card · 25 monitors free

Start monitoring in minutes.

The free plan includes 25 monitors, one server and a public status page. Add your first check and choose where alerts should be sent.