Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

API monitoring: status, body, latency and auth

API monitoring calls your endpoints on a schedule and checks more than the status code: the JSON body, the response time and the authentication path. A 200 with an empty or wrong body is still an outage for the client calling it.

The short answer
  • Assert on the body, not just the status. APIs often return 200 with an error object.
  • Track time to first byte and total time as separate numbers.
  • Use a dedicated read-only token and a cheap health endpoint to avoid side effects.

What should an API check assert?

Assertions by layer
AssertionExampleCatches
Status code200, or 204 for empty responsesServer errors and routing failures
Body fieldJSON status equals "ok", array not emptyWrong or empty data behind a 200
Response timeUnder 800 msSlow queries and overloaded workers
Auth pathValid token returns 200, no token returns 401Broken login or token validation
HeadersContent-Type is application/jsonError pages served as HTML

How can you test an endpoint with curl first?

curl: status code and timings in one line
curl -s -o /dev/null \
  -H "Authorization: Bearer $TOKEN" \
  -w "status=%{http_code} ttfb=%{time_starttransfer}s total=%{time_total}s\n" \
  https://api.example.com/v1/health

# example output
status=200 ttfb=0.182s total=0.201s

What status codes should alert and which should not?

Not every error code means your API is down. Some mean your monitor is misconfigured, and alerting on those wastes attention.

5xx

Server failure. Alert after a confirming retry.

401 or 403 on an authenticated check

Token expired or revoked. The API may be fine, but your monitor is blind until the token is fixed.

429

The API is rate limiting your monitor. Lower the check frequency or ask for an exemption.

Setup checklist

  • Create a health endpoint that touches the database or cache, not just the web server.
  • Use a read-only token created only for monitoring, and rotate it on a calendar.
  • Alert on slow responses against a baseline, not only on failures.
  • Monitor the endpoints your own front end depends on, not only the public docs example.
  • Keep check frequency below the rate limit to avoid causing the 429s you then alert on.

How do you build a reliable API check?

A good API check is a small contract test run from outside. Build it in this order so each step has something to compare against.

  1. 01

    List the calls your product depends on

    Your own front end, mobile app and partner integrations each use a few endpoints. Start with those.

  2. 02

    Write the expected response

    Record a good response and decide which fields must always be present, such as an id or a status.

  3. 03

    Add a latency limit

    Use your normal 95th percentile plus margin, then watch for sudden jumps.

  4. 04

    Handle authentication separately

    Test both the happy path and the rejected path, and alert when the token itself fails.

  5. 05

    Confirm failures before alerting

    Retry once and check from a second region, because APIs often have brief spikes.

Common mistakes in API checks

  • Checking only the status code and missing a 200 response that contains an error object.
  • Using a production admin token for monitoring, which is a security risk if it leaks.
  • Monitoring the documentation page instead of the endpoints clients actually call.
  • Setting one global timeout for slow reports and fast lookups alike.

Common questions

What is API monitoring?

Scheduled requests to API endpoints that verify availability, correct response content and speed. It alerts when an endpoint errors, times out, returns unexpected data or gets slow.

How is API monitoring different from website monitoring?

Website checks usually verify a page loads. API checks add assertions on structured responses, authentication headers, request methods and payloads, and they run against endpoints with no visual page.

Should API health checks hit the database?

A shallow check that only answers 200 can mislead you. A deeper endpoint that runs a trivial query tells you whether the stack behind the API works. Keep it cheap and rate limited so it cannot overload the service.

What response time is good for an API?

It depends on the endpoint. Set the limit from your own baseline, such as the 95th percentile over a normal week plus margin, instead of copying a generic number.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.