Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Collection exports and API description

Every catalogue example (see Route catalogue) is available as a ready-made collection for the usual API clients, grouped by category. WebSocket endpoints and examples that never end (live feeds) are left out, because plain HTTP clients cannot run them. Some examples contain placeholders such as <access_token> or <from-step-1> where a value from an earlier response belongs.

RouteFormatBase URL setting
/export/postman.jsonPostman collection v2.1 (download)collection variable base_url
/export/insomnia.jsonInsomnia export v4 (download)environment variable base_url
/export/bruno.jsonBruno collection (download)base_url
/export/curl.shBash script of curl commandsBASE_URL=... bash rustybin-curl.sh
/export/requests.httpVS Code REST Client / JetBrains HTTP Client@base_url at the top
/export/requests.hurlHurl file (asserts only HTTP *)hurl --variable base_url=...
/export/k6.jsk6 script (one iteration, checks that each request got a response)BASE_URL=... k6 run rustybin-k6.js
/export/har.jsonHAR 1.2 archiveabsolute URLs on the base URL

The base URL written into every format is the origin the export was downloaded from: the scheme of the listener (https on the HTTPS port), the Host header, and, with RUSTYBIN_TRUST_FORWARD=true, the Forwarded / X-Forwarded-Proto / X-Forwarded-Host / X-Forwarded-Port headers of your proxy. Download an export through your gateway and it already points at the gateway.

GET {{base_url}}/export/postman.json
HTTP 200
[Asserts]
jsonpath "$.info.schema" contains "v2.1.0"
jsonpath "$.variable[0].key" == "base_url"
jsonpath "$.variable[0].value" == "{{base_url}}"

To target another URL, pass ?base_url= (an absolute http or https URL, with an optional path prefix such as https://gateway.example.com/rustybin; no credentials, query or fragment). Anything else is a 400 with a JSON error. You can still change the variable after importing.

GET {{base_url}}/export/postman.json?base_url=https://gateway.example.com/rustybin
HTTP 200
[Asserts]
jsonpath "$.variable[0].value" == "https://gateway.example.com/rustybin"

GET {{base_url}}/export/curl.sh?base_url=not-a-url
HTTP 400
[Asserts]
jsonpath "$.error" == "invalid base_url"
GET {{base_url}}/export/insomnia.json
HTTP 200
[Asserts]
jsonpath "$.__export_format" == 4

GET {{base_url}}/export/bruno.json
HTTP 200

GET {{base_url}}/export/curl.sh
HTTP 200
[Asserts]
body startsWith "#!"

GET {{base_url}}/export/requests.http
HTTP 200

GET {{base_url}}/export/requests.hurl
HTTP 200
[Asserts]
body contains "HTTP"

GET {{base_url}}/export/k6.js
HTTP 200
[Asserts]
body contains "k6/http"

GET {{base_url}}/export/har.json
HTTP 200
[Asserts]
jsonpath "$.log.version" == "1.2"

A mock as a collection

GET /_rustybin/mocks/{name}/collections/{format} writes one mock's operations as a collection: postman, hurl, curl, http, k6, bruno or insomnia, one valid sample request per operation (?base_url= as above). Callers who cannot change the mock get placeholders for its demo credentials. Spec text that would break a line (a newline, the Unicode line and paragraph separators, NEL) is written on one line, and a spec path with whitespace or a control character is not served, so a spec cannot add requests to a downloaded file. The dev portal offers the same downloads for published mocks.

OpenAPI

/openapi.json and /openapi.yaml describe the HTTP API (OpenAPI 3.0.3), and /docs renders it as an interactive reference (the Scalar viewer, loaded from a CDN, so /docs needs internet access unlike the web console). The viewer's script is pinned to one version with Subresource Integrity, the document is inlined into the page, and the page is served with Content-Security-Policy: sandbox allow-scripts allow-popups, so it runs in an opaque origin: the viewer cannot read the console's stored token or cookies. Import the spec into a gateway to generate routes, or into a client generator. The landing page / lists every endpoint with a runnable example.

GET {{base_url}}/openapi.json
HTTP 200
[Asserts]
jsonpath "$.openapi" == "3.0.3"
jsonpath "$.paths['/echo']" exists
jsonpath "$.paths['/mcp']" exists

GET {{base_url}}/openapi.yaml
HTTP 200
[Asserts]
body startsWith "openapi: 3.0.3"
GET {{base_url}}/docs
HTTP 200
[Asserts]
header "Content-Type" contains "text/html"
GET {{base_url}}/
HTTP 200
[Asserts]
header "Content-Type" contains "text/html"
body contains "/openapi.json"

The examples in this documentation (docs/examples/) are a more thorough, assertion-checked alternative to the generated Hurl export.

On every surface

The same job from the API, the console, the command line, an agent and the configuration document.

SurfaceWhere
APIGET /export/{format} for the catalogue, GET /_rustybin/mocks/{name}/collections/{format} and /_rustybin/mocks/{name}/export for a mock, /openapi.json, /openapi.yaml, /docs
ConsoleAPI explorer downloads, a mock's Download menu, the portal's download buttons
CLIrustybin mocks collection <name> <format> [--base-url U], rustybin mocks export [name], rustybin instance catalog (reference)
Management MCPexport_collection, find_endpoints, get_mock_spec; the resource rustybin://catalogue (agent page)
rustybin.yamlrustybin config export is the export of the whole instance (the whole instance as code)
EnvironmentNone