/api/v1/binsList every bin owned by the API-key user, newest first. Returns names, IDs, creation times, and retained-request counts.
Bearer keyDeveloper platform
Build local webhook workflows with the versioned API, a dependency-free CLI, reusable SDK examples, and an OpenAPI 3.1 contract. Creating a bin confirms acceptance of the Terms and Conditions.
Management endpoints use /api/v1. Compatible fields may be added within v1, but existing fields and behavior will not be removed or changed incompatibly. A breaking contract change will use a new major path. Capture URLs remain /b/:binId/* so webhook destinations do not change when the management API evolves.
curl -fsS https://freebin.org/freebin.mjs -o freebin.mjs chmod +x freebin.mjs FREEBIN_API_KEY=YOUR_API_KEY ./freebin.mjs bins
The CLI supports bins, create, send, requests, watch, export, replay, local-forward, assert, and delete-request. Watch and local-forward emit JSON lines and accept --include-existing. Local forwarding runs in the CLI, so it can reach localhost while still stripping authorization, cookies, credential-like, hop-by-hop, and source-address headers. Set FREEBIN_URL=http://127.0.0.1:8787 for local development.
./freebin.mjs assert BIN_ID --method POST --path '/webhooks/*' \ --header x-event=invoice.created --body-json data.status=paid --timeout 30
Assertions combine method, path glob, repeated header, repeated body substring, and repeated JSON dot-path predicates with AND semantics. Exit code 0 indicates a match, 2 a timeout, and 1 a usage or operational error.
{
"mcpServers": {
"freebin": {
"url": "https://freebin.org/mcp"
}
}
} The stateless Streamable HTTP server provides list_bins, list_requests, get_request, and replay_request. OAuth-capable clients discover Freebin automatically, use authorization code flow with S256 PKCE, and show an explicit consent screen for read and replay scopes. Account API keys remain a compatibility option through a custom bearer header. Both methods return owned bins only. Request bodies are bounded before entering model context, and replay uses the same destination allowlist, egress limits, retention, sensitive-header stripping, and mutation audit trail as the browser and API.
curl -X POST https://freebin.org/api/v1/bins \
-H "authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"name":"Payments dev","termsAccepted":true}'curl -X POST https://freebin.org/b/YOUR_BIN_ID/events \
-H "authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"status":"ok"}'curl "https://freebin.org/api/v1/bins/YOUR_BIN_ID/interactions?limit=50" \ -H "authorization: Bearer YOUR_API_KEY"
The browser inspector filters its loaded retained history by free text, HTTP method, capture time range, path, content type, header name and value, and dotted JSON body fields. Filter and paging state is encoded in the URL and restored by browser history, making a filtered inspector URL shareable with another authorized user. Named saved views are planned for a later phase.
Export a versioned document containing the bin name, fallback response, forwarding configuration, and ordered conditional response rules. The document excludes captures, replay history, account ownership, Freebin API keys, public-share tokens, rule IDs and revisions, and internal enforcement metadata. User-authored response bodies, headers, destinations, and rule values may still be sensitive, so review a file before sharing it.
curl https://freebin.org/api/v1/bins/YOUR_BIN_ID/config \ -H "authorization: Bearer YOUR_API_KEY" \ -o freebin-config.json curl -X PUT https://freebin.org/api/v1/bins/OTHER_BIN_ID/config \ -H "authorization: Bearer YOUR_API_KEY" \ -H "content-type: application/json" \ --data-binary @freebin-config.json
Imports replace the destination bin’s portable fields and all rules atomically while preserving its captured requests and replay attempts. Local rule IDs and revisions are regenerated. The import must satisfy the destination account’s limits, and enabled forwarding must target an origin permitted by that deployment. Validate files against bin-config.v1.json.
Send an account API key as Authorization: Bearer YOUR_API_KEY. Keys are user-scoped, shown only once, individually revocable, and limited to five active keys per account. Every capture method requires a key belonging to the destination bin’s owner.
All currently implemented API and capture endpoints are listed below. Public share URLs are read-only web pages rather than JSON API endpoints.
Management endpoints intended for integrations and the first-party browser. Replace path parameters with IDs returned by the API.
/api/v1/binsList every bin owned by the API-key user, newest first. Returns names, IDs, creation times, and retained-request counts.
Bearer key/api/v1/binsCreate a private bin with a bearer key or browser session. Without credentials, creates a public bin that cannot capture. Send termsAccepted: true; names default to Untitled bin.
Optional bearer key or session/api/v1/bins/:binIdRead a bin’s name, response and forwarding configuration, creation time, and current public-share token.
Bearer, session, or token query/api/v1/bins/:binIdCustomize capture response fields and optional Phase 0 automatic forwarding to one allowlisted HTTPS base URL.
Bearer key or session/api/v1/bins/:binIdPermanently delete the bin and all of its retained requests.
Bearer key or session/api/v1/bins/:binId/configExport or atomically replace the versioned portable bin configuration and ordered response rules. Captures and replay history are preserved.
Bearer key or session/api/v1/bins/:binId/auditList the newest permission-gated mutation events; up to 500 are retained per bin.
Bearer key or session/api/v1/bins/:binId/collaboratorsList, invite or update, and remove registered-user collaborators. Invitation changes remain owner-only.
Session required/api/v1/bins/:binId/rulesList, create, or reorder conditional response rules. Enabled rules use first-match-wins order.
Bearer key or session/api/v1/bins/:binId/rules/:ruleIdUpdate or delete one conditional response rule.
Bearer key or session/api/v1/bins/:binId/rules/testTest a synthetic request against enabled rules without capturing it.
Bearer key or session/api/v1/bins/:binId/interactions?limit=10&offset=0List retained requests. limit accepts 1–100 or all and defaults to 10; responses include total and offset metadata.
Bearer, session, or token query/api/v1/bins/:binId/stream?lastId=:requestIdOpen a server-sent event stream. Emits request events and keepalives for about 25 seconds; reconnect to continue.
Bearer, session, or token query/api/v1/bins/:binId/exportDownload bin metadata and every currently retained request as JSON.
Bearer key or session/api/v1/bins/:binId/shareEnable or disable a read-only public bin URL with {"public":true|false}. Enabling again rotates the URL.
Bearer key or session/api/v1/bins/:binId/interactions/:requestIdPermanently delete one retained request.
Bearer key or session/api/v1/bins/:binId/interactions/:requestId/exportDownload one retained request as JSON.
Bearer key or session/api/v1/bins/:binId/interactions/:requestId/shareEnable or disable a read-only public request URL with {"public":true|false}.
Bearer key or session/api/v1/bins/:binId/interactions/:requestId/replayList the newest 50 retained replay attempts, including effective request snapshots and results.
Bearer key or session/api/v1/bins/:binId/interactions/:requestId/replayReplay an optionally edited request, or forward the original through the bin’s configured destination with operation: "forward". Every attempt is recorded.
Bearer key or session/api/v1/bins/:binId/interactions/:requestId/forwardingList retained automatic-forwarding attempts for one captured request.
Bearer key or sessionOAuth-capable MCP clients discover these endpoints automatically. Freebin requires authorization code flow with S256 PKCE and explicit account consent.
/.well-known/oauth-protected-resource/mcpDescribe the protected MCP resource, authorization server, and baseline scopes.
Public/.well-known/oauth-authorization-serverPublish authorization, token, registration, revocation, scope, and PKCE metadata.
Public/oauth/authorizeAuthenticate the account, display requested access, and approve or deny the OAuth grant.
Session required/oauth/tokenExchange an authorization code, refresh an access token, or revoke a token according to advertised metadata.
OAuth client/oauth/registerRegister a compatible OAuth client dynamically. Client ID Metadata Documents are also supported.
PublicCapture URLs are deliberately outside the management API version. They remain stable destinations for webhook senders.
/b/:binId/*Capture a GET request and return the bin’s configured response.
Bearer key required/b/:binId/*Capture a POST request and return the bin’s configured response.
Bearer key required/b/:binId/*Capture a PUT request and return the configured response.
Bearer key required/b/:binId/*Capture a PATCH request and return the configured response.
Bearer key required/b/:binId/*Capture a DELETE request and return the configured response.
Bearer key required/b/:binId/*Capture an OPTIONS request and return the configured response.
Bearer key requiredThese endpoints support the first-party web application. Session endpoints use the secure HttpOnly cookie set during registration or login.
/api/configReturn public browser configuration: signup availability plus the optional RUM beacon-script URL and public token.
Public/api/auth/registerCreate an account and session. Requires email, a 10–128 character password, termsAccepted: true, and enabled signups.
Public/api/auth/loginValidate email and password and create a 30-day session cookie.
Public/api/auth/logoutDelete the current server session and clear its cookie.
Session optional/api/meReturn the signed-in account, byte usage and limit, and owned bins. Returns user: null when signed out.
Session/api/mePermanently delete the signed-in account and clear its session.
Session required/api/account/tokenList API-key metadata. Full key values are never returned after creation.
Session required/api/account/tokenCreate a named user API key. The full token is returned once; accounts may have five active keys.
Session required/api/account/tokenRevoke the key whose ID is supplied as {"id":"…"}.
Session required| Limit | Registered | Canonical demo |
|---|---|---|
| Capture rate | 20 requests/second per user | 1 request/second for the canonical demo |
| Request body | 1 MB | 20 KB for the canonical demo |
| Retention | 5 MB per account by default | 1 MB for the canonical demo |
| Bins | 5 per account | Subject to creation abuse controls |
| API keys | 5 active per account | Not applicable |
| List page | 1–100 requests or all; default 10 | |
| Custom response fields | 500 UTF-8 bytes per text field and serialized headers field | |
| Conditional response rules | 5 enabled and 10 total per bin; 25 enabled and 50 total per account | Same per-bin limits |
| Replay and forward egress | 20 requests/second per account | 1 request/second |
| Bulk egress concurrency | 3 requests in flight; no cancellation | |
Retention is byte-based across captures and replay history. Old replay attempts are evicted before captured requests when the account reaches its allowance. There is no date-based cleanup. Rate-limited requests return 429; oversized requests return 413.
Automatic forwarding is best-effort: one destination per bin, a 10-second timeout, no redirects, and no retries. Each captured request has separate pending, delivered, or failed attempt history with destination, response code, error, latency, and timestamps; the request-level fields summarize the latest result. The original path and query are appended to the configured base URL. Credential-like headers are stripped by default and may be retained with a per-bin allowlist. Authorization is always removed because it contains the Freebin API key; hop-by-hop and source-address headers are also never forwarded.
Conditional responses evaluate up to five enabled rules in order and stop at the first match. Each rule supports up to five AND conditions over method, path, query, selected headers, and JSON or form body fields using equals, exists, contains, or glob. Rules cannot inspect authorization or cookie headers. Static responses may delay for up to five seconds.
Replay attempts preserve the original capture and store the effective edited request plus its result separately. Replay history shares the account retention budget; oldest replay attempts are evicted before captured requests. Replay uses a 10-second timeout, does not follow redirects, and strips authorization, cookies, credential-like, hop-by-hop, and source-address headers.
JSON API errors use {"error":"Human-readable message"}. Clients should branch on HTTP status codes and treat the message as diagnostic text, not a stable machine identifier.