API Documentation
Everything you need to create bins, capture webhooks, and inspect requests programmatically.
#Base URL
All API endpoints are served from the HookTest domain.
https://hooktest.dev
#Create a Bin
Create a new webhook bin that captures incoming HTTP requests. No authentication is required for free bins.
/api/binsExample
curl -s -X POST https://hooktest.dev/api/bins | jq
# Response:
# {
# "slug": "abc123xyz",
# "url": "https://hooktest.dev/api/hook/abc123xyz"
# }The response includes a slug (unique identifier) and the full url where you can send webhooks. Free bins expire after 24 hours and accept up to 100 requests. Pro bins are permanent with unlimited requests.
#Send Webhooks to a Bin
Point any HTTP request at your bin URL. All methods are supported: GET, POST, PUT, PATCH, DELETE, and OPTIONS. Headers, body, and query parameters are all captured.
/api/hook/:slugExamples
POST with JSON body:
curl -X POST https://hooktest.dev/api/hook/abc123xyz \
-H "Content-Type: application/json" \
-d '{"event": "order.completed", "id": 42}'GET with query parameters:
curl "https://hooktest.dev/api/hook/abc123xyz?status=active&page=1"
PUT with custom headers:
curl -X PUT https://hooktest.dev/api/hook/abc123xyz \
-H "X-Webhook-Secret: mysecret123" \
-H "Content-Type: application/json" \
-d '{"user": "test", "action": "update"}'Response
By default the bin returns a 200 OK with an empty body. Every response includes an X-HookTest-Request-Id header with the unique request identifier.
HTTP/1.1 200 OK X-HookTest-Request-Id: req_k7m9x2... Content-Type: text/plain
#Inspect Captured Requests
Retrieve all captured requests for a bin. Each request includes the method, headers, body, query string, source IP, and timestamp.
/api/bins/:slugExample
curl -s https://hooktest.dev/api/bins/abc123xyz | jq
# Response:
# {
# "bin": {
# "slug": "abc123xyz",
# "requestCount": 3,
# "maxRequests": 100,
# "expiresAt": 1710000000,
# "createdAt": 1709913600
# },
# "requests": [
# {
# "id": "req_k7m9x2...",
# "method": "POST",
# "path": "/api/hook/abc123xyz",
# "headers": { "content-type": "application/json", ... },
# "body": "{\"event\": \"order.completed\", \"id\": 42}",
# "query": "",
# "sourceIp": "203.0.113.1",
# "createdAt": 1709913650
# }
# ]
# }You can also inspect requests in your browser by visiting hooktest.dev/bin/abc123xyz for a real-time visual feed.
#Real-time Streaming (SSE)
Subscribe to a Server-Sent Events stream to receive captured requests in real time. The connection stays open and pushes new requests as they arrive.
/api/bins/:slug/streamExample
curl -N https://hooktest.dev/api/bins/abc123xyz/stream
# Output (as requests arrive):
# data: {"id":"req_...","method":"POST","headers":{...},"body":"...","createdAt":1709913650}
#
# data: {"id":"req_...","method":"GET","headers":{...},"body":"","createdAt":1709913680}In JavaScript, you can use the EventSource API:
const source = new EventSource(
"https://hooktest.dev/api/bins/abc123xyz/stream"
);
source.onmessage = (event) => {
const request = JSON.parse(event.data);
console.log(request.method, request.body);
};#Webhook Forwarding
Forward captured webhooks to Slack, Discord, or any URL in real time. Forwarding is available on Pro plans. Manage rules from the dashboard or via the API.
Create a Forwarding Rule
/api/forwardingcurl -X POST https://hooktest.dev/api/forwarding \
-H "Content-Type: application/json" \
-b "webhookbin_session=YOUR_SESSION_TOKEN" \
-d '{
"binId": "bin_id_here",
"type": "slack",
"target": "https://hooks.slack.com/services/T.../B.../xxx"
}'Forwarding Types
| Type | Target | Description |
|---|---|---|
slack | Slack webhook URL | Posts a formatted message to a Slack channel |
discord | Discord webhook URL | Sends an embed to a Discord channel |
url | Any HTTPS URL | Forwards the full request payload via POST |
List Forwarding Rules
/api/forwarding?binId=BIN_IDDelete a Forwarding Rule
/api/forwarding?id=RULE_ID#Delete a Bin
Delete a bin and all its captured requests permanently. Requires ownership (either the session cookie or the owner token cookie set when the bin was created).
/api/bins/:slugcurl -X DELETE https://hooktest.dev/api/bins/abc123xyz \ -b "webhookbin_session=YOUR_SESSION_TOKEN"
#Rate Limits & Plans
Free
- -10 bins per hour per IP
- -100 requests per bin
- -24-hour bin expiry
- -256 KB max request body
Pro $4.99/mo
- -Unlimited bins
- -Unlimited requests per bin
- -Permanent bins (no expiry)
- -Webhook forwarding (Slack, Discord, URL)
- -Dashboard & bin management
Ready to start?
Create a free webhook bin in one click. No signup required.