Skip to content

An assertion is a condition your API response must meet. You add one or more assertions to a check, and when any of them is not met the check is marked failed and an alert is triggered.

  • Status code: compare the HTTP status code of the response with a number, for example Equals 200, or Less than 400.
  • Response time: compare the total response time, in milliseconds, with a number, for example Less than 800.
  • Body: check that the response body Contains, or Does not contain, a piece of text. The match is a literal, case-sensitive substring; regular expressions are not supported, and an empty value always fails.

For status code and response time you can choose Equals, Not equals, Equals or Greater than, Equals or Less than, Greater than or Less than.

Set Assertions

  1. In the check form, find the Assertions section and click Add Assertion.
  2. Pick the type (Status code, Response time or Body).
  3. Pick the comparison and type the Value.
  4. Save the check.

When an assertion fails, the check details page shows which assertion failed, so you can see why the check was marked failed.

If a check is slower than its response time limit it is marked degraded. If it also has a failing assertion, the check is marked failed.

  • Performance: a Response time assertion with Less than sets a hard ceiling for your API.
  • Error detection: a Status code assertion catches unexpected errors.
  • Content: a Body assertion confirms that the response still contains the value you expect, for example a field name or a keyword.

Multistep checks support the same assertions on each step, see Multistep API Checks.