Requests API
Inspect and replay webhook requests
The Requests API allows you to inspect, replay, and manage webhook requests captured by your endpoints.
Authentication
All endpoints in this section require JWT Bearer authentication:
Authorization: Bearer <JWT_TOKEN>
Request Object
{ "id": "req_cm1a2b3c4d5e6f7g8h9i0j1k", "endpointId": "cm1a2b3c4d5e6f7g8h9i0j1k", "method": "POST", "path": "/webhook", "query": { "utm_source": "email", "campaign_id": "123" }, "headers": { "content-type": "application/json", "user-agent": "Stripe/1.0", "x-stripe-signature": "t=1234567890,v1=..." }, "body": { "event": "payment_intent.succeeded", "data": { "object": { "id": "pi_123", "amount": 5000 } } }, "ip": "192.168.1.100", "userAgent": "Stripe/1.0", "createdAt": "2024-01-15T14:25:00.000Z" }
Attributes
| Attribute | Type | Description |
|---|---|---|
| id | string | Unique identifier for the request |
| endpointId | string | ID of the endpoint that received this request |
| method | string | HTTP method (GET, POST, PUT, DELETE, etc.) |
| path | string | Request path (after the slug) |
| query | object | Query parameters as key-value pairs |
| headers | object | Request headers as key-value pairs |
| body | any | Request body (JSON, string, or null) |
| ip | string | Source IP address |
| userAgent | string | User-Agent header value |
| createdAt | string | ISO 8601 timestamp of when request was received |
API Endpoints
List Requests for Endpoint
Retrieves a paginated list of requests for a specific endpoint.
GET /api/endpoints/:endpointId/requests
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
endpointId(path) - The endpoint ID
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | number | 1 | Page number |
| limit | number | 20 | Items per page (max 100) |
Response:
{ "data": [ { "id": "req_cm1a2b3c4d5e6f7g8h9i0j1k", "endpointId": "cm1a2b3c4d5e6f7g8h9i0j1k", "method": "POST", "path": "/webhook", "query": {}, "headers": { "content-type": "application/json" }, "body": { "event": "test" }, "ip": "192.168.1.100", "userAgent": "Mozilla/5.0", "createdAt": "2024-01-15T14:25:00.000Z" } ], "meta": { "total": 42, "page": 1, "limit": 20, "totalPages": 3 } }
Status Codes:
200 OK- Requests returned404 Not Found- Endpoint not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X GET "https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k/requests?page=1&limit=20" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Get Request
Retrieves a specific request by ID with full details.
GET /api/requests/:id
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
id(path) - The request ID
Response:
{ "id": "req_cm1a2b3c4d5e6f7g8h9i0j1k", "endpointId": "cm1a2b3c4d5e6f7g8h9i0j1k", "method": "POST", "path": "/webhook", "query": { "source": "api" }, "headers": { "content-type": "application/json", "user-agent": "Stripe/1.0", "x-stripe-signature": "t=1234567890,v1=..." }, "body": { "event": "payment_intent.succeeded", "data": { "object": { "id": "pi_123", "amount": 5000, "currency": "usd" } } }, "ip": "54.187.216.72", "userAgent": "Stripe/1.0", "createdAt": "2024-01-15T14:25:00.000Z" }
Status Codes:
200 OK- Request returned404 Not Found- Request not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X GET https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_cm1a2b3c4d5e6f7g8h9i0j1k \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Replay Request
Forwards a captured request to a different URL, optionally overriding request properties.
POST /api/requests/:id/replay
Headers:
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
Parameters:
id(path) - The request ID to replay
Request Body:
{ "url": "https://example.com/webhook", "method": "POST", "headers": { "x-custom-header": "custom-value" }, "body": { "overridden": true } }
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Target URL to send the request to |
| method | string | No | Override HTTP method |
| headers | object | No | Override or add headers |
| body | any | No | Override request body |
Note: If not provided, method, headers, and body will use the values from the original request.
Response:
{ "success": true, "status": 200, "statusText": "OK", "headers": { "content-type": "application/json", "x-request-id": "abc123" }, "body": { "received": true, "id": "evt_123" }, "duration": 245 }
Response Attributes:
| Attribute | Type | Description |
|---|---|---|
| success | boolean | Whether the replay was successful |
| status | number | HTTP status code from target server |
| statusText | string | HTTP status text |
| headers | object | Response headers from target server |
| body | any | Response body from target server |
| duration | number | Request duration in milliseconds |
| error | string | Error message if replay failed (optional) |
Status Codes:
200 OK- Replay completed (checksuccessfield for actual result)404 Not Found- Request not found or not owned by user400 Bad Request- Invalid URL or request parameters401 Unauthorized- Invalid or missing authentication
Example:
curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_cm1a2b3c4d5e6f7g8h9i0j1k/replay \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhook" }'
Replay with overrides:
curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_cm1a2b3c4d5e6f7g8h9i0j1k/replay \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "http://localhost:3000/webhook", "method": "POST", "headers": { "x-test-mode": "true" } }'
Delete Request
Deletes a specific request.
DELETE /api/requests/:id
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
id(path) - The request ID
Response:
{ "deleted": true }
Status Codes:
200 OK- Request deleted404 Not Found- Request not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X DELETE https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_cm1a2b3c4d5e6f7g8h9i0j1k \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Delete All Requests for Endpoint
Deletes all requests for a specific endpoint.
⚠️ Warning: This action is irreversible.
DELETE /api/endpoints/:endpointId/requests
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
endpointId(path) - The endpoint ID
Response:
{ "deleted": 42 }
Status Codes:
200 OK- Requests deleted (returns count)404 Not Found- Endpoint not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X DELETE https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k/requests \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Request Storage & Retention
Storage Limits
Maximum requests stored per endpoint by tier:
| Tier | Max Requests per Endpoint |
|---|---|
| Free | 100 |
| Starter | 1,000 |
| Pro | 5,000 |
| Enterprise | Unlimited |
When the limit is reached, the oldest requests are automatically deleted (FIFO).
Retention Period
Requests are automatically deleted after:
| Tier | Retention Period |
|---|---|
| Free | 24 hours |
| Starter | 7 days |
| Pro | 7 days |
| Enterprise | 30 days |
Request Replay
Use Cases
- Local Development: Replay production webhooks to your local development server
# Start local server npm run dev # Replay webhook to localhost curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_xyz/replay \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "http://localhost:3000/webhook"}'
- Testing: Replay webhooks to staging environments
curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_xyz/replay \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://staging.example.com/webhook"}'
- Debugging: Replay with modified data to test edge cases
curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/requests/req_xyz/replay \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "http://localhost:3000/webhook", "body": { "amount": 999999, "test_case": "large_amount" } }'
Security Considerations
- Replay requests are sent from HooksDash servers, not from the original source
- The
X-Forwarded-Forheader will contain the original request IP - Signature headers (like
X-Stripe-Signature) are preserved but may be invalid if the body is modified - Only replay to URLs you control and trust
Replay Errors
Common error responses:
{ "success": false, "error": "Connection refused", "duration": 1000 }
{ "success": false, "status": 500, "statusText": "Internal Server Error", "error": "Target server error", "duration": 532 }
Filtering & Searching
Filter by Method
# Get all POST requests curl -X GET "https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k/requests" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ | jq '.data[] | select(.method == "POST")'
Filter by IP
# Get requests from specific IP curl -X GET "https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k/requests" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ | jq '.data[] | select(.ip == "54.187.216.72")'
Search Body Content
# Search for requests containing specific event curl -X GET "https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k/requests" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ | jq '.data[] | select(.body.event == "payment_intent.succeeded")'
Best Practices
-
Regularly clean up old requests: Delete requests you no longer need to free up storage
-
Use pagination: Don't request all requests at once; use pagination for better performance
-
Replay selectively: Don't replay all requests; select specific ones for testing
-
Preserve original data: When replaying, avoid modifying the request unless necessary for testing
-
Monitor retention: Be aware of your tier's retention period and export important requests before they expire
-
Use filters: Filter requests client-side after fetching to find specific patterns
Request Analysis
Understanding Headers
Common headers you'll see in webhook requests:
content-type: Format of the request body (application/json, application/xml, etc.)user-agent: Client that sent the requestx-forwarded-for: Original client IP (if proxied)- Signature headers: Webhook signature for verification (e.g.,
x-stripe-signature,x-hub-signature)
Body Formats
Request bodies can be:
- JSON object: Most common for modern webhooks
- JSON array: Less common but possible
- String: For form data, XML, or plain text
- null: For GET requests or requests without a body
Query Parameters
Query parameters are stored separately from the path and body:
{ "path": "/webhook", "query": { "source": "api", "version": "2" } }
Full URL would be: https://hooksdash.ibadsiddiqui.dev/api/h/your-slug/webhook?source=api&version=2