Webhook Testing
Mock API
FastHook can turn a source URL into a mock API endpoint. Match incoming requests by method, path, query, headers, or JSON body fields, then return the status code, headers, content type, and response body your test needs.
Unlike a throwaway mock server, FastHook also stores the request, routes matching events to destinations, and keeps debugging evidence for replay, alerts, archives, and delivery attempts.
Create mock API sourceRead dynamic response docs
What a FastHook mock API can do
- Return different responses for different paths such as /orders, /customers, or /health.
- Return custom status codes, including success and error cases.
- Match query parameters, headers, and nested JSON body fields.
- Echo request values in the response with templates.
- Capture every request for inspection before and after a test run.
- Route accepted mock traffic to Slack, Google Sheets, S3, R2, email, HTTP destinations, and more.
Example dynamic response rule
{
"custom_response": {
"content_type": "json",
"body": "{\"ok\":true,\"fallback\":true}",
"rules": [
{
"name": "create order",
"match": {
"method": "POST",
"path": "/orders",
"body": {
"type": "order.created",
"data.id": { "$exists": true }
}
},
"response": {
"status": 201,
"content_type": "json",
"headers": {
"x-mock-rule": "create-order"
},
"body": "{\"ok\":true,\"order_id\":\"{{body.data.id}}\",\"request_id\":\"{{request.id}}\"}"
}
}
]
}
}Mock API vs request bin vs mock destination
| Feature | Best for | FastHook object |
|---|---|---|
| Mock API | Replying to callers with realistic dynamic responses. | Source custom_response rules. |
| Request bin | Temporary capture and payload discovery. | Temporary source URL. |
| Mock destination | Testing outbound routing without calling a real receiver. | Destination type MOCK_API. |
Common use cases
- Frontend integration tests that need stable API responses.
- Partner onboarding before a real backend endpoint exists.
- Provider verification screens that expect a specific body or status code.
- Webhook demos where the source must respond like an application.
- Error-path testing with 400, 404, 409, 429, or 500 style responses.
FAQ
Can FastHook work as a mock API?
Yes. A FastHook source can return dynamic responses based on method, path, query parameters, headers, and JSON body fields while still capturing the request for debugging.
Can a mock response return different status codes?
Yes. Each dynamic response rule can set a status code such as 200, 201, 202, 400, 404, or 409.
Can FastHook echo request values in a mock response?
Yes. Response bodies can use templates such as {{request.id}}, {{path}}, {{headers.x-request-id}}, {{query.mode}}, and {{body.data.id}}.
Is this the same as a mock destination?
No. A dynamic source response replies to the caller that sends the inbound request. A mock destination tests outbound delivery after FastHook routing.
Can mock API requests still be routed to destinations?
Yes. FastHook can return the source response immediately and still create events for active connections so destinations, logs, alerts, or archives receive the accepted request.