API Reference
The RequestBin API lets you manage bins, interactions, replay jobs, and forwarding rules programmatically. All endpoints authenticate with an API key (free on every plan; create up to 5 per account).
Authentication
Include your API key in the Authorization header as a Bearer token:
curl https://requestbin.net/api/bins \ -H "Authorization: Bearer rb_your_api_key_here"
Base URL
https://requestbin.net/api
Bins
GET /api/bins
List all bins you own or have access to.
curl https://requestbin.net/api/bins \ -H "Authorization: Bearer rb_your_key"
Response: { "bins": [{ "binId", "name", "url", "stats": { "requestCount", "unviewed" } }] }
POST /api/bins
Create a new webhook bin.
curl -X POST https://requestbin.net/api/bins \
-H "Authorization: Bearer rb_your_key" \
-H "Content-Type: application/json" \
-d '{"name": "Stripe Webhooks", "serverId": "your-server-id"}'Body: { "name": string (required), "serverId": string (required), "note": string (optional) }
Response (201): { "bin": { "binId", "url", "name" }, "correlation": { "correlationId", "serverUrl" } }
GET /api/bins/:id
Get bin details including recent interactions.
curl https://requestbin.net/api/bins/BIN_ID \ -H "Authorization: Bearer rb_your_key"
Response: { "bin": { ... }, "interactions": [{ "method", "path", "headers", "body", "timestamp" }], "stats": { "total", "unviewed" } }
DELETE /api/bins/:id
Delete a bin (soft delete). Only the owner can delete.
curl -X DELETE https://requestbin.net/api/bins/BIN_ID \ -H "Authorization: Bearer rb_your_key"
Response (200): { "message": "Bin deleted" }
Interactions
GET /api/bins/:id/interactions
List captured HTTP requests for a bin.
curl "https://requestbin.net/api/bins/BIN_ID/interactions?limit=20" \ -H "Authorization: Bearer rb_your_key"
Query params: limit (default 50), before (cursor pagination)
Response: { "interactions": [{ "_id", "protocol", "method", "path", "headers", "body", "timestamp" }] }
Replay
POST /api/replay/jobs
Replay an HTTP request to any URL. The request is executed server-side.
curl -X POST https://requestbin.net/api/replay/jobs \
-H "Authorization: Bearer rb_your_key" \
-H "Content-Type: application/json" \
-d '{
"requestSpec": {
"method": "POST",
"url": "https://your-server.com/webhook",
"headers": [{"key": "Content-Type", "value": "application/json", "enabled": true}],
"query": [],
"body": "{\"event\": \"test\"}",
"bodyMode": "json",
"auth": {"type": "none"},
"options": {"retry": "none", "delayMs": 0}
},
"sourceType": "manual"
}'Response (202): { "job_id": "uuid", "status": "queued" }
GET /api/replay/jobs/:id
Check replay job status and result.
curl https://requestbin.net/api/replay/jobs/JOB_ID \ -H "Authorization: Bearer rb_your_key"
Response: { "status": "succeeded|failed|queued|running", "result": { "statusCode", "headers", "body", "timingMs" } }
Forwarding Rules
GET /api/forwarding-rules
List your forwarding rules.
curl https://requestbin.net/api/forwarding-rules \ -H "Authorization: Bearer rb_your_key"
Response: { "rules": [{ "ruleId", "name", "binId", "destinationId", "conditions", "isActive" }] }
Error Codes
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | Insufficient plan or permission |
404 | Resource not found |
429 | Rate limit exceeded (60 requests/minute) |
500 | Internal server error |