Free tools

Free REST API Response Assertion Tester

Validate API responses with deterministic assertions using contains checks, JSONPath rules, and XPath expressions.

Copy-paste outputs

The autonomous growth engine for your business.

Brand Armor AI finds where your customers are, decides what to create, distributes it across the channels that matter, and learns from every result.

Discover customer opportunitiesPlan campaignsCreate posts, images, and videosPublish across channelsMeasure what worksAI search visibilityDiscover customer opportunitiesPlan campaignsCreate posts, images, and videosPublish across channelsMeasure what worksAI search visibility
Social publishingBlog and CMS deliveryEmail outreachAutopilot workflowsBrand IdentityWeekly reportsSocial publishingBlog and CMS deliveryEmail outreachAutopilot workflowsBrand IdentityWeekly reports
Shopping IntelligenceCompetitor AnalysisBrand IdentityShopping IntelligenceCompetitor AnalysisBrand Identity

Tool 01

REST Response Assertion Tester

Validate API responses with string, JSONPath, and XPath assertions in one local workflow.

REST Response Assertion Tester
Validate API responses with deterministic string, JSONPath, and XPath assertion rules.
Assertion results
0 passed / 3 failed / 3 total

contains:success

Substring not found in response.

jsonpath:$.status==ok

Response is not valid JSON for JSONPath assertion.

xpath://status/text()==ok

DOMParser is not defined

[
  {
    "assertion": "contains:success",
    "pass": false,
    "details": "Substring not found in response."
  },
  {
    "assertion": "jsonpath:$.status==ok",
    "pass": false,
    "details": "Response is not valid JSON for JSONPath assertion."
  },
  {
    "assertion": "xpath://status/text()==ok",
    "pass": false,
    "details": "DOMParser is not defined"
  }
]

How it works

REST Response Assertion Tester: methodology and worked example

How this tool computes its result

Each assertion line is parsed as `type:expression==expected` (expected is optional). "contains"/"notContains" do plain substring checks against the raw response body text. "jsonpath" first attempts JSON.parse on the whole response body (guarded in a try/catch — if parsing fails, every jsonpath assertion automatically fails with "Response is not valid JSON") and then runs the jsonpath-plus library against the parsed object. "xpath" parses the response body as XML via DOMParser and runs doc.evaluate. When an expected value is given, matched values are compared with stringifyValue (JSON.stringify for non-strings) using strict string equality against the expected text.

Worked example

Response body `{"status":"ok","data":{"count":3}}` with assertions "contains:success" and "jsonpath:$.status==ok": the first fails ("Substring not found in response.") since the literal word "success" is not in the body; the second passes ("Expected value matched (ok).") since JSONPath `$.status` resolves to "ok", which stringifies to exactly "ok".

When not to use this tool

xpath assertions require the response body to parse as well-formed XML — running an xpath assertion against a JSON response body throws "Invalid XML input for XPath assertions." rather than gracefully skipping. The expected-value comparison is also plain string equality on stringified output, so a JSONPath match returning the number 3 must be compared against the literal text "3", not left ambiguous.

Common mistakes

  • - Writing `xpath:` assertions against a JSON API response — this always fails at the DOMParser stage regardless of whether the logical assertion would otherwise be true.
  • - Omitting `==expected` when an exact-value check was intended — without it, the assertion only checks "at least one match exists," not that the match equals a specific value.
  • - Assuming assertion type names are case-sensitive or exact — the parser lowercases only the `type` prefix before the first colon, so a stray space or unsupported keyword (e.g. "jsonPath" vs "jsonpath" with different casing works, but "json-path" would not) falls into the "Unknown assertion type" branch.

Ready to put your growth work on autopilot?

Connect your business once, then let Brand Armor AI find opportunities, create content, publish it, and learn from what brings customers in.