50% bonus credits + 2x signup credits View Offer
5 min read

How do I monitor my API with UpCanary?

Set up HTTP monitoring for your REST API with status code and response body assertions.

HTTP monitoring is the most effective way to verify your API is up and returning correct responses - not just that the server is accepting connections, but that the application logic is actually working. This guide walks through setting up a monitor for a REST API health endpoint.

Step 1: Create the Monitor

  1. Sign in to app.upcanary.io and click New Monitor from the dashboard.
  2. Select HTTP / HTTPS as the check type.
  3. Enter your API health endpoint URL, for example:
    https://api.example.com/health
    Most APIs expose a dedicated health or status endpoint. If yours does not, use any lightweight endpoint that returns a meaningful response - /ping, /status, or even / if the root responds correctly.
  4. Set the HTTP method to GET.

Step 2: Configure Assertions

Assertions tell UpCanary what a passing response looks like. Without assertions, any HTTP response - including a 500 error - would be treated as “up”.

Status code assertion

Add a status code assertion and set it to 200. This ensures the monitor only passes when the API returns a successful response.

Response body assertion (recommended)

For stronger coverage, add a response body assertion. If your health endpoint returns a JSON body like:

{ "status": "ok" }

Add a body contains assertion for the string ok or healthy (whatever your endpoint actually returns). This catches cases where the server returns 200 but the application is in a degraded state.

Step 3: Set Check Interval and Regions

  • Interval: Set to 1 minute for production APIs. This gives you fast detection without excessive credit consumption. Use 30 seconds only if you have strict SLA requirements.
  • Regions: Leave all regions selected. Multi-region consensus means UpCanary only alerts when 2 or more regions confirm the failure, which eliminates false positives from transient network issues.

Step 4: Set Up an Email Alert

  1. Under Notifications, click Add Channel.
  2. Select Email and enter the address that should receive alerts.
  3. Configure the alert to fire on Down and Recovery events so you know both when the API fails and when it comes back up.

You can add multiple email addresses or reuse a notification channel you’ve already configured.

Step 5: Save and Verify

Click Save Monitor. Within the first check interval, the monitor dashboard will show:

  • A green Up badge if all regions are returning the expected status code and body
  • Response times broken down by region
  • A live response time chart

If the monitor shows Down or Degraded immediately, click into it to see which regions are failing and what response was returned. Common causes are an incorrect URL path, authentication required on the health endpoint, or a firewall blocking external requests.

Tips

  • Use a dedicated health endpoint - a /health or /ping route that does a shallow check (e.g., confirms the server is alive and can reach its database) is faster and cheaper to monitor than a full application endpoint.
  • Avoid endpoints that require authentication - the monitor makes unauthenticated requests by default. If your health route is behind auth, either create a separate public health route or use the custom headers feature to pass a static API key.
  • Check your timeout - the default request timeout is 10 seconds. If your API sometimes takes longer to respond under load, your monitor may report intermittent failures that are actually slow responses.