API tests

Verify backend endpoints directly without a browser, which is faster, less flaky, and ideal for contracts.

View as Markdown

API tests verify backend endpoints directly, without a browser. They are faster than UI tests, less flaky because there is no rendering to go wrong, and ideal for asserting that contracts between services hold steady. If a journey can be expressed entirely as HTTP calls, an API test is almost always the better tool, leaving the browser-level tests to focus on what only they can cover.

  1. 1Each step is one HTTP request, with its method and path.
  2. 2How many assertions guard that response. A request with none proves very little.
  3. 3The full URL the request targets.
  4. 4Add another request, or let the AI extend the test from a description.

The API builder

Create a test with the API type and you will be taken to the API builder. From there you chain together HTTP requests (GET, POST, PUT, PATCH, DELETE) each with their own URL, headers, body, and assertions. You reorder them by dragging, duplicate them when you want a similar request, and add as many as you need. The builder is intentionally close to a Postman collection in shape, which keeps the learning curve short for anyone who has used those tools before.

Chaining requests with variables

Variables are the feature that makes API tests powerful. You can capture a value from one response (an auth token from a login call, an ID from a create call) and reuse it in later requests using {{variable_name}} syntax in URLs, headers, and bodies. That makes it easy to model real workflows like "log in, create a record, fetch it back, update it, delete it, confirm it is gone", with each step using values produced by the previous ones.

Assertions on responses

Assertions on API responses include status code, JSON body shape, specific JSON path values, header values, and response time. Use them generously. A green run with no assertions just means the server returned something, not that it returned the right thing. With well-placed assertions, an API test is the closest thing to a contract test you can have without touching the codebase, and it will catch silent regressions long before a user does.

Importing an existing collection

If you already have a Postman collection or an OpenAPI specification, the importer will turn it into a test in one click so you do not have to recreate everything by hand. API tests run against the same scheduling, notification, and webhook plumbing as web tests, so you can mix browser and API tests freely in a suite to cover both layers of your stack with a single set of triggers.

Still stuck, or spotted something out of date?

Contact support