API Tests
Synthetic API testing with assertions and scheduled runs
What are API tests?
API tests let you make HTTP requests to your APIs on a schedule and assert conditions on the response. Think of it as synthetic monitoring with built-in validation.
Creating a test
Go to Monitoring > API Tests and click New API Test:
- Name — label for this test (e.g. "Check user endpoint")
- URL — the API endpoint to test
- Method — GET, POST, PUT, etc.
- Headers — custom headers (JSON format)
- Body — request body for POST/PUT requests
- Check interval — how often to run, in seconds
- Timeout — max wait time per request
Assertions
Define what a "passing" response looks like. Assertions are JSON-formatted rules that check:
- Status code — response must return a specific HTTP status
- Response time — must respond within a time limit
- Body contains — response body must include specific text
- JSON path — a specific field in the JSON response must match
If any assertion fails, the test is marked as failing.
Alerts
Same pattern as monitors and heartbeats:
- Alert after N failures — consecutive failures before alerting
- Alert email — email on failure
- Alert webhook — POST with test result details
Result history
Each test run records:
- Pass/fail status
- Response status code and time
- Response headers and body preview
- Individual assertion results (pass/fail per rule)
- TLS certificate expiry (days remaining)
- Error messages for network failures
Run on demand
Click Run Now on any test to trigger an immediate execution, useful for verifying a fix before waiting for the next scheduled run.
Credits
API test runs are free and do not consume credits.