Skip to content Use Monity from Claude, ChatGPT or Codex: set up monitors and ask what changed, from a chat. Use Monity from Claude, ChatGPT or Codex Connect yours
Tutorial 5 min read

API monitoring: how to check your endpoints and get alerts when they fail

What API monitoring should check on each endpoint, which endpoints to watch first, a worked example of a health check with JSON and header checks every minute, multi-step flows with browser tests, and what an outside monitor can’t see.

Kamil Software engineer
UpdatedNovember 23, 2026 Read time5 min AudienceDevelopers, SaaS engineering and platform teams, and agencies that run APIs for clients

API monitoring means calling your endpoints on a schedule from outside your network and alerting when one fails: a wrong status code, a slow answer, a missing field in the JSON or an expired certificate. A 200 alone proves little, so check a value in the body too. In Monity (monity.ai), a Website uptime monitor sends any method with your headers and body, checks JSON values and headers in the answer, and runs every 30 seconds to every hour, depending on the plan.

What should an API monitor check?

Check What it catches Example rule
Status code Server errors, broken auth, a removed route 200-299. On a private endpoint called without a token, 401
Response time A slow database, a cold start, a timeout Alert when 3 checks in a row take over 2,000 ms; give up after 10 seconds
JSON body A 200 that carries an error or no data $.status equals ok; $.data[0].id exists
Headers A proxy’s HTML error page, a wrong version Content-Type contains application/json
Certificate and domain Expiry, a missing intermediate Warn 14 days before the certificate expires, 30 days before the domain
DNS A record changed or deleted The CNAME of api.example.com includes your load balancer’s host name

The 401 check catches a private endpoint that became public. RFC 9110 defines 401 as a request that “lacks valid authentication credentials”, so a 200 there means anyone can read it. Give it a monitor of its own with no token, on an endpoint your other monitors don’t call: a workspace has one Website monitor per address.

Which endpoints should you monitor first?

  1. A health endpoint that checks what the API depends on (database, queue, cache) and reports each one in JSON. One that always answers 200 only proves the web server is up.
  2. The endpoint customers call most, with a read-only key from a test account.
  3. Sign-in: the token endpoint, called with a test client’s credentials, checking that the answer has $.access_token. Every 5 or 15 minutes is enough, and stays clear of any monthly limit your identity provider puts on issued tokens.
  4. Writes, carefully. A check every minute is 43,200 calls a month, so never create real orders or send real emails. Use a test account, a dry-run option, or an idempotent call such as a PUT on the same record.

Example: an API health check every minute

Say GET https://api.example.com/health answers:

HTTP/1.1 200 OK
Content-Type: application/json

{"status": "ok", "version": "2026.11.3", "checks": {"database": "ok", "queue": "ok"}, "queue_depth": 12}

Set up a Website uptime monitor in Monity like this:

  1. Open Uptime, click New monitor, choose Website and enter https://api.example.com/health.
  2. In Request options, keep the method GET and add the header Authorization: Bearer <key> with a read-only key. POST, PUT, PATCH, DELETE, HEAD and OPTIONS work too, with a body for POST, PUT and PATCH.
  3. Under When it counts as down, set Good status codes to 200-299 and add checks on the answer: $.status equals ok, $.checks.database equals ok, $.queue_depth is less than 1000, and the header Content-Type contains application/json. You can add up to 10, and all must pass.
  4. Turn on Alert when responses are slow at 2,000 ms and set Give up after to 10 seconds.
  5. Choose every minute, click Test now to see one real check, then Create monitor.

When the database check fails, the incident reads $.checks.database is “degraded”, expected “ok”.

What happens when a check fails

Before it alerts, Monity checks again 3 and 6 seconds later, and before a network error counts it makes sure its own connection works, so one dropped request doesn’t wake anyone. The incident shows the status, where the time went (DNS, connect, TLS, first byte), the response headers, the start of the answer and a likely cause. You can alert at once or only after 1 to 60 minutes down, send reminders until someone acknowledges, and get a recovery alert when it’s back.

A Monity uptime incident for HTTP 503 Service Unavailable on https://httpbin.org/status/503, with the likely cause (the server behind the proxy is not answering), Monity AI’s reading, and a timeline: went down, alert sent, acknowledged, a note about a deploy, and the end
A 503 from a public test endpoint. The alert went out 10 seconds after the first failed check, once both re-checks had failed too; the likely cause, Monity AI’s reading and the on-call note sit on one page.

Alerts go to email, Slack, Microsoft Teams, Discord, Telegram, Google Sheets, a webhook or the phone app. The webhook is signed and sends events such as uptime.down, uptime.up and uptime.slow, which you can forward to an on-call tool: Monity has no on-call schedules of its own. Monitors can be created from code through the REST API (/api/v1/uptime), and a public status page can show them to your customers. Certificate expiry warnings arrive the same way; SSL certificate expiry monitoring covers what to set.

How to monitor a multi-step API flow

An uptime monitor makes one request with fixed headers. It can’t sign in, take a token from the answer and use it in a second call, so give monitors a long-lived, read-only API key, not a token that expires in an hour.

For a flow through your app (sign up, sign in, create a record, see it listed), use a browser test. It runs the steps in a Firefox-based browser in Monity’s cloud, so it calls your API the way your front end does. Steps are written without code, passwords go into encrypted secrets, and a step can type a two-factor code. Run it on a schedule, from every 5 minutes to once a day as your plan allows, and after each deploy from a GitHub Actions workflow. A run uses 1 credit per started minute in the browser.

What Monity doesn’t do for APIs

  • Private APIs. Checks come from Monity’s servers on the internet, and private network addresses are refused. For an internal API, run a small job inside your network that calls the endpoint and then a heartbeat link on success, as in cron job monitoring. If you already run Prometheus, its blackbox_exporter probes internal endpoints for free.
  • Where your users are. Response times are measured from Monity’s servers, not from your users’ countries. They tell you the API slowed down, not how long a user in Sydney waits.
  • Scripted chains and contract tests. No request chaining, no OpenAPI schema validation, and JSON paths are simple ($.data[0].id, no filters). Tools that script API checks in code do this; Monity vs Checkly compares one.
  • Tracing. Monity sees your API from outside. Errors inside a request, traffic per endpoint and traces need an APM tool.

Each endpoint is one monitor. The free plan has 3, checked every 5 minutes at most. Personal Small checks every minute, and 20 endpoints use about 880 of its 1,000 credits a month ($12 a month, or $10 billed yearly). Business Small has 30 monitors, 5,000 credits and 3 seats ($35 a month, or $25 billed yearly). Prices as of 23 November 2026.

FAQ

Questions people ask

What is the difference between API monitoring and API testing?

Testing runs checks against a build before or right after a release. Monitoring runs them against the live API on a schedule. The same checks often serve both: Monity’s browser tests run after each deploy and on a schedule, and its uptime monitors run around the clock.

Is API monitoring the same as API observability?

No. Monitoring asks known questions from outside: does this endpoint answer, in time, with the right data? Observability collects logs, metrics and traces from inside the API so you can work out why it failed. Monitoring tells you something is wrong; observability helps you find the cause. Monity does the outside part only.

How often should I check an API?

Every minute for endpoints customers or partners call, and every 5 to 15 minutes for back-office and batch endpoints. In Monity a one-minute check uses about 44 credits a month and a five-minute one about 9. Every 30 seconds, on Personal Large and up, finds an outage up to 30 seconds sooner for about 87 credits.

Can I monitor a GraphQL API?

Yes. Send a POST with a JSON body such as {"query": "{ __typename }"}, then check that $.data exists and $.errors does not. GraphQL servers often answer 200 even when the query failed, so the body checks matter more than the status.

How do I monitor an API that needs an API key?

Add the key as a header in the monitor’s request options, for example Authorization: Bearer … or X-Api-Key. Use a read-only key from a test account, made only for monitoring, so you can revoke it without breaking anything else. When the key rotates, update the monitor, or the check fails with a 401.

What response time should trigger a slow alert?

Watch the monitor’s response-time chart for a week, then set the limit above the normal peaks. Monity alerts when three checks in a row are slower than the limit, so one slow answer doesn’t alert. If you have no history yet, 2 seconds is a reasonable first limit for a JSON endpoint. A check’s time includes the DNS lookup, the connection and the TLS handshake, so it runs higher than the server-side latency your APM reports.

Written by

Kamil

Kamil is a software engineer at Monity and works on the engine behind it: the browser that loads each page, the uptime checks and the alerts. He writes about the technical side of keeping websites, APIs and scheduled jobs working.

More by author
Kamil, Alex and Martyna A person replies within two working days

Have a question?

Pricing, security or scoping: pick one and your message goes to a person on the team.