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: 200 OK

{
"id": "fwd_ghi789",
"status": "completed",
"target_url": "http://localhost:3000/webhook",
"method": "POST",
"response_status": 200,
"duration_ms": 45,
"inserted_at": "2025-01-15T11:05:00Z"
}

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": "completed",
"response_status": 200,
"duration_ms": 45,
"target_url": "http://localhost:3000/webhook",
"inserted_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",
"status": "completed",
"request_headers": {
"content-type": "application/json"
},
"request_body": "{\"type\":\"payment_intent.succeeded\"}",
"response_status": 200,
"response_headers": {
"content-type": "application/json"
},
"response_body": "{\"received\":true}",
"duration_ms": 45,
"error": null,
"inserted_at": "2025-01-15T11:05:00Z"
}
}