Browse docs

Monitor API uptime

Set up HTTP monitors for your API endpoints and get notified the moment they go down.

APIs fail in ways that your main application won't always surface. A single endpoint can start returning 500 errors while the rest of the app looks fine. WatchCat checks your endpoints continuously so you find out before your users do.

Step 1 — choose what to monitor

The best URL to monitor depends on what you want to verify. A few common options:

Health check endpoint /health or /up — purpose-built for monitoring, returns 200 when the app is ready. The most reliable option.
Public API root e.g. https://api.example.com/v1 — confirms routing and TLS are working. Simpler to set up if you don't have a dedicated health endpoint.
Critical endpoint e.g. /v1/products — monitors a specific route that customers depend on. More targeted but may return non-200 for legitimate reasons.

A dedicated health endpoint is the most reliable choice. It can check database connectivity, cache availability, and other dependencies in a single request — giving WatchCat a truthful signal about whether the API is actually functional.

Adding a health endpoint

If your API doesn't already have one, here's a minimal health endpoint for common stacks. It should return HTTP 200 when healthy and a non-200 status when something is wrong.

Rails

# config/routes.rb
get "/up" => "rails/health#show"

# Or a custom check:
get "/health", to: proc { |env|
  ActiveRecord::Base.connection.execute("SELECT 1")
  [200, {}, ["ok"]]
}

Express (Node.js)

app.get('/health', async (req, res) => {
  await db.raw('SELECT 1');
  res.json({ status: 'ok' });
});

Laravel

Route::get('/health', function () {
    DB::select('SELECT 1');
    return response()->json(['status' => 'ok']);
});

Step 2 — create the monitor

In WatchCat, go to Monitors → New monitor and enter your endpoint URL. Choose an interval and a failure threshold that matches how sensitive this service is.

Interval 1 min for customer-facing APIs; 5 min for internal tools
Alert after 2 failures — filters transient blips without delaying real alerts
Expected status 200 for a clean health endpoint

Expected status codes

By default, any 2xx response is treated as a success. For APIs that return other codes intentionally, you can configure exactly which status codes count as healthy. Supported formats:

200 Exact match
2xx Any code in the 200–299 range
200-204 Numeric range
2xx,404 Comma-separated list — any 2xx or a 404 is fine

POST checks and GraphQL

Some endpoints answer nothing useful to a GET. A GraphQL API is the clearest case: it speaks POST only, so a GET against /graphql tells you nothing about whether your resolvers are alive. Pick POST (or PUT or PATCH) as the HTTP method under Advanced → Request settings and a body field appears:

{ "query": "{ __typename }" }

That query is the cheapest honest GraphQL health probe — it exercises the endpoint, the parser and the schema without touching your data. The body is sent as JSON unless you set a Content-Type header yourself, and the same status and content checks apply to the response. JSON-RPC and SOAP endpoints work the same way.

Point it at something safe to repeat. A monitor sends its body on every check, from every region — a 1-minute monitor is thousands of requests a day. Choose a read-only query or a health endpoint, never one that creates orders, sends mail, or changes data.

Custom request headers

Some APIs require authentication headers or custom routing headers on every request. Open Advanced → Request settings in the monitor form and add them as name and value pairs — "Add header" gives you another row, and the name field suggests common header names as you type. Each one is sent with every check:

Authorization Bearer YOUR_API_KEY
X-Api-Key YOUR_API_KEY

Cookies work the same way in the Cookies rows just below, which is what you want for an endpoint gated behind a cookie rather than a header. They are combined into a single Cookie header on every check.

Note: Headers are stored in WatchCat and sent with each check. Avoid putting credentials here that would be harmful if exposed. For monitoring purposes, a read-only health endpoint that doesn't require authentication is the safest choice.

Response content checks

A 200 status code doesn't always mean the API is working correctly. Some services return 200 with an error message in the body. Use content checks to verify the response actually contains what you expect:

Response must contain

A string that must appear in the response body. If it's missing, the check is treated as a failure. Useful for verifying a health endpoint returns ok or your API returns a known key.

Response must not contain

A string that must not appear. If it does, the check fails. Useful for detecting known error messages even when the HTTP status is 200.

SSL certificate monitoring

WatchCat checks the TLS certificate on every HTTPS request. An expired or invalid certificate triggers an incident immediately, without waiting for the normal failure confirmation window. This means you'll know about certificate problems before clients start seeing errors.

Start monitoring in minutes

Free plan available. No credit card required.