Skip to Content
MonitoringResponse Validation

Response Validation

Response validation lets you verify the content of HTTP responses, not just the status code.

Validation Types

JSONPath Expressions

Extract values from JSON responses using JSONPath expressions and compare them against expected values.

Example: Verify that a health endpoint returns "ok":

  • JSONPath: $.status
  • Expected value: ok

For an API response like:

{ "status": "ok", "version": "2.1.0" }

The JSONPath $.status extracts "ok", which matches the expected value.

Common JSONPath Expressions

ExpressionDescription
$.statusRoot-level “status” field
$.data.countNested field access
$.items[0].nameFirst item’s name in an array
$.items.lengthNumber of items in an array

Comparison Operators

Each JSONPath assertion compares the extracted value with an operator:

OperatorPasses when
equalsThe value equals the expected value (default)
not_equalsThe value differs from the expected value
containsThe value contains the expected value
existsThe path resolves to a value (no expected value needed)
greater_than, greater_or_equal, less_than, less_or_equalNumeric comparison. The expected value must be a number

Multiple Assertions (AND / OR)

Add several JSONPath assertions to one check, for example $.status equals ok and $.queue.depth is less than 1000. Choose how they combine:

  • All (default): every assertion must pass (AND)
  • Any: one passing assertion is enough (OR)

A check can have up to 20 assertions.

Text Containment

Verify that the response body contains a specific text string. This is useful for:

  • HTML pages that should contain specific content
  • API responses where you want to verify a keyword exists
  • Simple health checks that return plain text

With several strings, choose all (default, every string must appear) or any (at least one).

Must Not Contain

Fail the check if any of the listed strings appear in the response body, for example maintenance or error. Useful for pages that return 200 while showing an error. Up to 10 strings.

How Validation Works

  1. The check runs normally and receives a response
  2. If the status code matches the expected code, response validation runs
  3. If validation fails, the check is marked as failed (same as a status code mismatch)
  4. Smart verification and consecutive failure thresholds apply to validation failures

Limitations

  • Response validation is only available for website and API checks (not TCP/UDP)
  • JSONPath validation requires the response to be valid JSON
  • Text containment and must-not-contain are case-insensitive
  • The full response body is available for validation (no size limit on the validation itself)

Best Practices

  • Use JSONPath validation for structured API responses
  • Use text containment for HTML pages or simple text responses
  • Keep validation expressions simple and focused on critical values
  • Test your JSONPath expressions against sample responses before configuring checks
Last updated on