Skip to main content

Request Forwarding API

Forward captured requests to any URL and view forward history.

Forward a request

POST /api/v1/endpoints/:endpoint_id/requests/:request_id/forward
curl -X POST https://app.hooklistener.com/api/v1/endpoints/ep_abc123/requests/req_def456/forward \
-H "Authorization: Bearer hklst_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"target_url": "http://localhost:3000/webhook",
"method": "POST"
}'

Request body:

FieldTypeRequiredDescription
target_urlstringYesURL to forward the request to
methodstringNoOverride HTTP method (defaults to original)

Response: 202 Accepted

{
"forward_id": "fwd_ghi789",
"debug_request_id": "req_def456",
"target_url": "http://localhost:3000/webhook",
"status": "pending"
}

List forwards for a request

GET /api/v1/endpoints/:endpoint_id/requests/:request_id/forwards
curl "https://app.hooklistener.com/api/v1/endpoints/ep_abc123/requests/req_def456/forwards?page=1&page_size=20" \
-H "Authorization: Bearer hklst_your_api_key"

Response:

{
"data": [
{
"id": "fwd_ghi789",
"method": "POST",
"status_code": 200,
"duration_ms": 45,
"target_url": "http://localhost:3000/webhook",
"assertion_status": null,
"created_at": "2025-01-15T11:05:00Z"
}
],
"page": 1,
"page_size": 20,
"total": 3
}

Get a forward

GET /api/v1/forwards/:id
curl https://app.hooklistener.com/api/v1/forwards/fwd_ghi789 \
-H "Authorization: Bearer hklst_your_api_key"

Response:

{
"data": {
"id": "fwd_ghi789",
"method": "POST",
"target_url": "http://localhost:3000/webhook",
"request_headers": {
"content-type": "application/json"
},
"request_body": "{\"type\":\"payment_intent.succeeded\"}",
"status_code": 200,
"response_headers": {
"content-type": "application/json"
},
"response_body": "{\"received\":true}",
"duration_ms": 45,
"error_message": null,
"assertion_status": null,
"assertion_details": null,
"created_at": "2025-01-15T11:05:00Z"
}
}