Skip to content

API client

Save captured requests

Turn requests captured by Cloak Proxy into saved API client requests with Save to API Client, keeping headers, body and the response as an example.

Any request the proxy captured can become a saved request in the API client. The client copies its method, URL, headers and body, and keeps the response as an example. Use it to reproduce what an app sent, tweak it and send it again, add tests to it, or start a collection for an API you’re learning from real traffic.

A captured request carries real credentials. They come along when you save it.

  1. Right-click a request, or several selected requests
  2. The selected request
  3. Its Authorization header is copied as is
  4. So is its Cookie header
The traffic list of requests to api.example.com with one GET /v1/users request selected, and the inspector below showing its Authorization bearer token and Cookie header
  1. In the main window’s traffic list, select the request. Select several to save them together.
  2. Right-click and choose Save to API Client. With several selected, it reads Save N Requests to API Client.
  3. The API client opens with the last saved request in a tab, inside a collection called Captured Requests.

The Captured Requests collection is created the first time and reused after that. Each request is added at its top level. Move them into other collections or folders by dragging them in the sidebar; see Collections and requests.

Save to API Client isn’t available for CONNECT tunnels the proxy didn’t decrypt, since there’s no request inside to copy. Turn on SSL Proxying for the host and capture it again.

You can also save the selected request from global search (⇧ ⌘ A): search for Save Selected Request to API Client.

Part In the saved request
Name The method and path, such as GET /v1/users.
Method and URL As captured, including the query string.
Query parameters Listed on the Params tab.
Headers Every request header except Host, Content-Length, Connection, Proxy-Connection and Accept-Encoding, which the client sets itself.
Form body (application/x-www-form-urlencoded) An x-www-form-urlencoded body with one row per field. The captured Content-Type header is dropped, since the body type sets it.
Other text bodies A Raw body. JSON is pretty-printed. The language is JSON or XML from the Content-Type, otherwise TEXT. Compressed bodies are decoded first.
Response Saved as an example named after the status, such as “200 OK”, with its headers (minus Content-Length, Content-Encoding, Transfer-Encoding, Connection and Date) and decoded body.

Binary request bodies, such as images or Protobuf, aren’t copied. Auth isn’t detected: an Authorization header stays a header, and the request’s Authorization tab is set to Inherit auth from parent.

The saved request has its examples ready for a mock server and exported docs.

A captured request is a snapshot of one call. Before you reuse or share it:

  1. Replace the host with a variable. Change https://api.example.com/v1/users to {{baseUrl}}/v1/users and set baseUrl in an environment.
  2. Move credentials out of headers. Delete the captured Authorization header and set up auth on the Authorization tab, or on the collection, with a value from a secret variable or {{vault:name}}.
  3. Delete the Cookie header unless the API needs it. The client keeps its own cookie jar from the responses it gets.
  4. Remove headers that only made sense for the original app, such as tracing IDs.
  5. Rename the request to say what it does.
Method Result
Export a session as HAR, then import it into the client A collection named after the file, with one folder per host. Responses become examples.
Copy as cURL on a captured request (right-click it in the traffic list), then paste into a request’s URL field in the client (⌘ T opens a new one) The method, URL, headers and body fill in that request. See Copy as code.
The MCP tool save_captured_request An AI assistant saves a captured request into a collection (default Captured Requests). See MCP tools reference.

To change a captured request and send it again without saving it in the client, use Edit and Repeat… in the proxy. See Repeat and compose.