Skip to main content

Request Forwarding

Request forwarding lets you replay captured webhook requests to any URL. Forward to your local development server, a staging environment, or another endpoint.

Forwarding from the dashboard

  1. Open a captured request in the dashboard
  2. Click Forward
  3. Enter the target URL (e.g., http://localhost:3000/webhook)
  4. Click Send

The request is replayed with the original method, headers, and body. You can view the forwarding result including the target's response status, headers, and body.

Forwarding from the CLI

# Forward a single request
hooklistener endpoint forward-request <endpoint-id> <request-id> http://localhost:3000/webhook

# Override the HTTP method
hooklistener endpoint forward-request <endpoint-id> <request-id> http://localhost:3000/webhook --method POST

# List all forwards for a request
hooklistener endpoint forwards <endpoint-id> <request-id>

# View forward details
hooklistener endpoint forward <forward-id>

Forwarding from the API

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

Real-time forwarding with the CLI

For continuous forwarding during development, use the listen command:

hooklistener listen my-endpoint --target http://localhost:3000

This opens a WebSocket connection and forwards every new request to your local server as it arrives. See CLI Listen for details.

Forward details

Each forward attempt records:

  • Target URL — where the request was sent
  • HTTP method — the method used (original or overridden)
  • Response status — the target's HTTP status code
  • Response headers — headers returned by the target
  • Response body — body returned by the target
  • Duration — how long the forward took
  • Error — any connection or timeout errors

Viewing forward history

# List forwards for a request
hooklistener endpoint forwards <endpoint-id> <request-id> --page 1 --page-size 20

# View a specific forward
hooklistener endpoint forward <forward-id>

Or via the API:

# List forwards
curl "https://app.hooklistener.com/api/v1/endpoints/<endpoint-id>/requests/<request-id>/forwards?page=1&page_size=20" \
-H "Authorization: Bearer hklst_your_api_key"

# Get forward details
curl https://app.hooklistener.com/api/v1/forwards/<forward-id> \
-H "Authorization: Bearer hklst_your_api_key"