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 type | Status | Description |
|---|
status_code | Supported | Checks that the HTTP response status code matches an expected value or range. |
json_path | Supported | Evaluates a JSONPath expression against the response body and checks the result. |
header | Supported | Checks that a specific response header exists or has an expected value. |
body_contains | Supported | Checks that the raw response body contains a given string. |
body_equals | Supported | Checks that the raw response body exactly equals a given string. |
json_schema | Planned | Validates the response body against a JSON Schema definition. |
response_time | Planned | Asserts 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.
| Field | Required | Description |
|---|
type | yes | status_code |
expected | yes | The 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.
| Field | Required | Description |
|---|
type | yes | json_path |
path | yes | A JSONPath expression (e.g. $.user.id, $.items[*].status). |
operator | yes | How to evaluate the result. See operators below. |
expected | conditional | The value to compare against. Required for most operators; not used with exists or not_exists. |
json_path operators
| Operator | Description |
|---|
exists | The path resolves to at least one value. |
not_exists | The path does not resolve to any value. |
equals | The resolved value equals expected. |
not_equals | The resolved value does not equal expected. |
contains | The resolved value (string or array) contains expected. |
matches | The resolved value matches a regular expression in expected. |
greater_than | The resolved numeric value is greater than expected. |
less_than | The 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.
| Field | Required | Description |
|---|
type | yes | header |
name | yes | The header name (case-insensitive, e.g. content-type). |
operator | yes | exists, equals, contains, or matches. |
expected | conditional | The 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.
| Field | Required | Description |
|---|
type | yes | body_contains |
expected | yes | The 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.
| Field | Required | Description |
|---|
type | yes | body_equals |
expected | yes | The 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.
Related pages