# Capture a request Use an account API key from [Freebin Account](https://freebin.org/account). The examples below use the hosted service; substitute your instance origin when self-hosting. ## Create a bin Sign in at [Account](https://freebin.org/account) and create an API key in the API keys tab. Replace `YOUR_API_KEY` in the examples with that key. Create a bin and use the returned `bin.binId` wherever an example uses `YOUR_BIN_ID`. ```bash 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}' ``` ## Send a request ```bash 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"}' ``` A stored capture returns `X-Freebin-Captured: true`. The response status, headers, and body come from the first matching response rule or the bin’s fallback configuration. A configured error status can still indicate a successful capture. ## List captured requests ```bash curl "https://freebin.org/api/v1/bins/YOUR_BIN_ID/interactions?limit=50" \ -H "authorization: Bearer YOUR_API_KEY" ``` Headers and JSON or form fields with common credential names are redacted before storage. Private gzip bodies are returned as `freebin:base64:`. GET and HEAD captures have a null body. The public demo applies additional redaction and does not expose source addresses. Source: [Freebin API documentation](https://freebin.org/docs) and [Freebin quickstart](https://github.com/corridora/freebin/blob/main/QUICKSTART.md).