API Stash Docs Open app →

Requests

A request is the fundamental building block in API Stash. Compose it, send it, read the response, and save it as a versioned revision.

Building a request

Each request is made up of:

  • MethodGET, POST, PUT, PATCH, DELETE, and the rest.
  • URL — with support for {{VAR}} environment variables (see Environments).
  • Query params — managed in a key/value editor that stays in sync with the URL.
  • Headers — a key/value editor with sensible defaults and autocomplete.
  • Body — see the body types below.

Body types

API Stash supports the body formats you'll actually use:

  • JSON — with formatting and validation.
  • Text and XML.
  • Form URL-encoded (application/x-www-form-urlencoded).
  • Multipart form data, including file fields.
  • GraphQL — query plus variables editor.
POST https://api.example.com/v1/orders
Content-Type: application/json

{
  "sku": "WIDGET-1",
  "quantity": 2
}

Sending & reading the response

Press Send to dispatch the request. The response panel shows the status code, total time, response size, and headers, plus a body viewer that pretty-prints and lets you search JSON, XML, and HTML.

Saving & revisions

Saving stores the request in its collection. Every save is a versioned revision with author and timestamp, so you can diff and restore earlier versions at any time. See versioned history.

Per-request scripts

Requests can run small JavaScript at three points in their lifecycle:

  • Pre-request — set up variables, sign payloads, or compute dynamic values before the request is sent.
  • Post-response — extract values from the response (for example, capture a token) into variables for later use.
  • Tests — assert that the response looks the way you expect. Failing tests are surfaced in the response panel and cause CI runs to fail.

The same scripting model powers steps inside Flows.

Protocols supported

Beyond plain REST, API Stash supports a range of protocols so you can keep all your API work in one place:

  • REST / HTTP.
  • GraphQL.
  • gRPC.
  • WebSocket.