The saved request library

Save an HTTP request once and reuse it across API tests, instead of retyping the same call.

View as Markdown

API tests tend to repeat themselves. The same login call starts five tests; the same health check ends three more. Saved requests let you define a call once, with its method, URL, headers, body, and assertions, and then reference it wherever it is needed.

  1. 1Each step is one request. Save it to reuse the same call in another test.
  2. 2A saved request carries its assertions with it, so reuse does not mean re-asserting.
  3. 3The URL. Put the host in a variable so one request works across environments.
  4. 4Add another request, or import a batch from Postman or an OpenAPI spec.

Where they come from

Save a request from the API builder as you write it, or bring a batch in at once from a Postman collection or OpenAPI specification. A cURL command pasted from your browser’s network tab also becomes a saved request in one step.

Using one in a test

Add a request step and pick the saved request. It carries its headers and assertions with it, so a test built from saved requests starts out already asserting something rather than merely calling endpoints.

Keep credentials in variables

A saved request is shared across tests, so hard-coding a token into one spreads it everywhere. Put it in a variable marked secret instead, and rotating it stays a single edit.

Still stuck, or spotted something out of date?

Contact support