Skip to main content

UptimeRobot API Monitoring

Monitor your API endpoint responses with UptimeRobot

What is API monitoring?

API monitoring is a specialised type of monitoring that allows you to validate the actual content of your API responses, not just whether the endpoint is reachable. While standard HTTP monitors check if your server responds with a successful status code, API monitors go further by examining the JSON response body, response headers, status code, or raw response body and verifying that specific fields or values contain expected values.

This is particularly useful for:

  • Monitoring AI API Endpoints - Check response times, validating model outputs, and enforcing usage limits to catch failures before users do

  • Data integrity checks - Ensure critical data fields are present and have valid values

  • Third-party API dependencies - Monitor external APIs your application relies on

  • Microservices health - Validate that each service in your architecture is functioning correctly

Get started

To create an API monitor:

  1. Go to the UptimeRobot dashboard

  2. Click New on Monitors page

  3. Select API Monitoring as the monitor type

  4. Enter the URL of your API endpoint

  5. Expand Request Details to configure your authentication and payload data if necessary

  6. Configure assertions for JSON body fields, response headers, status codes, or raw response bodies (details below)

  7. Set up your notification preferences

  8. Click Create Monitor

Note: When you use JSON body assertions, the API endpoint must return a valid JSON response. If the JSON response is invalid, you will get an alert with Invalid JSON as the incident root cause.

Configure request details

API monitors support all the same request configuration options as HTTP monitors:

HTTP Method

Choose the HTTP method for your request: GET (default), POST, PUT, PATCH, DELETE, HEAD, QUERY, or OPTIONS.

Authentication

If your API requires authentication, you can configure:

  • HTTP Basic - Username and password sent in the Authorization header

  • Digest - More secure challenge-response authentication

  • Bearer Token - Token-based authentication (e.g., JWT, OAuth tokens)

Request Body

For POST, PUT, and PATCH requests, you can include a request body:

  • Key-Value pairs - Simple form data format

  • Raw JSON - Send a JSON payload directly

Custom Headers

Add custom HTTP headers to your request (e.g., Content-Type: application/json, X-API-Key: your-api-key).

Assertions

Assertions are the core feature of UptimeRobot API monitoring. They allow you to define conditions that must be met for the monitor to be considered "up". You can create assertions for JSON body fields, response headers, status codes, or raw response bodies.

JSONPath syntax

Use JSONPath expressions to specify which field to check in the response:

  • $.status - Root-level field named "status"

  • $.data.user.name - Nested field access

  • $.items[0].id - First element of an array

  • $.results[*].active - All "active" fields in the results array

Use JSONPath selectors only for JSON body fields.

Comparison operators

Operator

Description

Example

Equals

Field value must exactly match the target

$.status equals healthy

Not equals

Field value must not match the target

$.status not equals error

Contains

Field value must contain the target string or structured value

$.message contains success

Not contains

Field value must not contain the target string or structured value

$.error not contains critical

Greater than

Numeric field must be greater than target

$.count greater than 0

Less than

Numeric field must be less than target

$.errorCount less than 10

Is null

Field must be null or not exist

$.error is null

Is not null

Field must exist and not be null

$.data is not null

Targets can also be arrays or objects. Enter array and object targets as valid JSON.

For arrays and objects, you can use equality and containment comparisons, check whether a value is empty or not empty, or compare its length. Some comparisons do not require a target value, including null, empty, and not-empty checks.

Validation: Selectors and targets are validated when you configure an assertion. JSONPath selectors must be valid. JSON array and object targets cannot contain duplicate keys or unsafe numbers, and are subject to depth and size limits.

Combining assertions

You can add up to 5 assertions per monitor and combine them using:

  • AND - All assertions must pass for the monitor to be "up"

  • OR - At least one assertion must pass for the monitor to be "up"

Note: You can combine all these assertion features with other type of monitoring checks we already provide in HTTP monitoring such as response time alerts.

General Usage Examples

Health check endpoint

Monitor a typical health check endpoint that returns:

{
"status": "healthy",
"database": "connected",
"cache": "connected"
}

Assertions (using AND):

  1. $.status equals healthy

  2. $.database equals connected

  3. $.cache equals connected

AI Conversation Moderator Service

Monitor if your AI moderator behave the way you expect.

{
"allowed": false,
"reason": "disallowed_content",
"categories": ["fraud", "scam"],
"action": "block",
"message": "This request violates content policy"
}

Assertions (using AND):

  1. $.allowed equals false

  2. $.action equals block

  3. $.message is not null

AI Image Generation Service

Monitor an image generation API (like DALL-E, Stable Diffusion):

{
"service": "image-generation",
"status": "operational",
"gpu_available": true,
"queue_position": 0,
"models": {
"sdxl": "ready",
"dalle-3": "ready"
},
"avg_generation_time_seconds": 8.5
}

Assertions (using AND):

  1. $.status equals operational

  2. $.gpu_available equals true

  3. $.queue_position less than 100

  4. $.avg_generation_time_seconds less than 60

AI Content Summary Service

Monitor if your content summary API wrapper for contentn summary AI works as you expect:

{
"request_id": "req_a73c",
"status": "success",
"output": "Here is the summary...",
"usage": {
"prompt_tokens": 1200,
"completion_tokens": 180,
"total_tokens": 1380
},
"cost": {
"currency": "USD",
"amount": 0.00483
},
"provider": "anthropic",
"rate_limit": {
"remaining": 12
},
"timestamp": "2026-02-05T12:42:10Z"
}

Assertions (using AND):

  1. $.status equals success

  2. $.output is not null

  3. $.cost.amount greater than 0

  4. $.provider is not null

  5. Response time threshold set to 3000ms

E-commerce product availability

Monitor a product API to ensure items are in stock:

{
"product": {
"inventory": {
"available": 150
}
}
}

Assertion: $.product.inventory.available greater than 0

Error monitoring

Monitor an API that reports error counts:

{
"metrics": {
"errorRate": 0.05
}
}

Assertion: $.metrics.errorRate less than 1

Third-party API status

Monitor a third-party service status endpoint:

{
"status": {
"indicator": "none"
}
}

Assertions (using OR):

  1. $.status.indicator equals none

  2. $.status.indicator equals minor

AI Service Credits & Usage Check

If you are using an AI model provider, you could monitor account credits and usage via their API:

{
"data": {
"label": "My API Key",
"usage": 15.42,
"limit": 100,
"is_free_tier": false,
"rate_limit": {
"requests": 200,
"interval": "10s"
}
}
}

Assertions (using AND):

  1. $.data.usage less than 90 (alert before hitting limit)

  2. $.data.limit greater than 0

  3. $.data.rate_limit.requests greater than 0

AI Service Models Availability

Monitor available models:

{
"data": [
{
"id": "anthropic/claude-3.5-sonnet",
"name": "Claude 3.5 Sonnet",
"pricing": {
"prompt": "0.000003",
"completion": "0.000015"
}
}
]
}

Endpoint: GET https://openrouter.ai/api/v1/models

Assertions (using OR):

  1. $.data[*].id contains anthropic

  2. $.data[*].id contains openai

AI Completion Response Time Monitoring

Track API response times (monitor the time between request and response):

{
"id": "gen-abc123",
"model": "anthropic/claude-3.5-sonnet",
"created": 1234567890
}

Assertions:

  1. Response time less than 5000 milliseconds (alert on slow responses)

  2. $.id is not null (request completed)

AI Model Pricing Change Detection

If you are using a unified model provider like OpenRouter, you can monitor pricing for cost control:

{
"data": [
{
"id": "anthropic/claude-3.5-sonnet",
"pricing": {
"prompt": "0.000003",
"completion": "0.000015"
}
}
]
}

Assertions:

  1. $.data[?(@.id == 'anthropic/claude-3.5-sonnet')].pricing.prompt equals 0.000003 (alert on price changes)

  2. $.data[?(@.id == 'anthropic/claude-3.5-sonnet')].pricing.completion equals 0.000015

Did this answer your question?