Skip to main content
Assertions are how Reqflo verifies that a step or journey did what it was supposed to do. After a step executes, each configured assertion is evaluated against the response. A failed assertion marks the step as failed and surfaces in run output, reports, and coverage.

Assertion types

Assertion typeStatusDescription
status_codeSupportedChecks that the HTTP response status code matches an expected value or range.
json_pathSupportedEvaluates a JSONPath expression against the response body and checks the result.
headerSupportedChecks that a specific response header exists or has an expected value.
body_containsSupportedChecks that the raw response body contains a given string.
body_equalsSupportedChecks that the raw response body exactly equals a given string.
json_schemaPlannedValidates the response body against a JSON Schema definition.
response_timePlannedAsserts that the response completed within a maximum duration.
Planned assertion types are not yet available. The list above reflects reasonable near-term additions; only supported types can be used in journeys today.

status_code

Verifies the HTTP response status code.
FieldRequiredDescription
typeyesstatus_code
expectedyesThe expected status code as an integer (e.g. 200, 201, 404).
assertions:
  - type: status_code
    expected: 201

json_path

Evaluates a JSONPath expression against the response body and applies an operator.
FieldRequiredDescription
typeyesjson_path
pathyesA JSONPath expression (e.g. $.user.id, $.items[*].status).
operatoryesHow to evaluate the result. See operators below.
expectedconditionalThe value to compare against. Required for most operators; not used with exists or not_exists.

json_path operators

OperatorDescription
existsThe path resolves to at least one value.
not_existsThe path does not resolve to any value.
equalsThe resolved value equals expected.
not_equalsThe resolved value does not equal expected.
containsThe resolved value (string or array) contains expected.
matchesThe resolved value matches a regular expression in expected.
greater_thanThe resolved numeric value is greater than expected.
less_thanThe resolved numeric value is less than expected.
assertions:
  - type: json_path
    path: "$.order.status"
    operator: equals
    expected: "confirmed"

  - type: json_path
    path: "$.items"
    operator: greater_than
    expected: 0
Checks a response header’s presence or value.
FieldRequiredDescription
typeyesheader
nameyesThe header name (case-insensitive, e.g. content-type).
operatoryesexists, equals, contains, or matches.
expectedconditionalThe value to compare against. Not used with exists.
assertions:
  - type: header
    name: content-type
    operator: contains
    expected: "application/json"

body_contains

Checks that the raw response body string includes a given substring. Useful for non-JSON responses or quick spot-checks.
FieldRequiredDescription
typeyesbody_contains
expectedyesThe substring to look for in the response body.
assertions:
  - type: body_contains
    expected: "payment_confirmed"

body_equals

Checks that the raw response body exactly matches a given string.
FieldRequiredDescription
typeyesbody_equals
expectedyesThe full expected response body as a string.

Assertions and coverage

Assertions on steps contribute to journey coverage — they represent verifiable acceptance criteria. The Coverage panel helps you see which criteria are mapped and where gaps exist. See Coverage for more.