# Webhook Relay Inspector (/docs/experiments/webhook-relay-inspector)



Create a unique inbound URL per session with a **Durable Object**. Any HTTP request to that URL is captured (method, headers, body, timestamp) and can be listed or inspected for webhook debugging.

## Features [#features]

* POST /relay/new - create a capture session
* ALL /relay/:id - capture inbound requests
* GET /relay/:id/requests - list captures
* GET /relay/:id/requests/:requestId - full request details

## API Reference [#api-reference]

### POST /relay/new [#post-relaynew]

Create a new relay session.

#### Success Response [#success-response]

```json
{ "id": "abc123", "inboundUrl": "https://your-worker.workers.dev/relay/abc123" }
```

### ALL /relay/:id [#all-relayid]

Captures any inbound HTTP request to the session.

### GET /relay/:id/requests [#get-relayidrequests]

List captured requests (summary).

### GET /relay/:id/requests/:requestId [#get-relayidrequestsrequestid]

Full request details including headers and body.

#### Error Codes [#error-codes]

* `404` - `NOT_FOUND`
* `400` - `INVALID_ID`

## Use Cases [#use-cases]

* Debug Stripe, GitHub, or custom webhook payloads during integration
* Share a temporary inbound URL with a third party for testing
* Inspect headers and raw body without deploying a full receiver

## Limitations [#limitations]

* Requires Durable Objects binding and migration
* Sessions are not authenticated; anyone with the URL can post
* Storage is bounded by DO limits; not long-term log retention

## Deployment [#deployment]

<Steps>
  <Step>
    ### Click the deploy button [#click-the-deploy-button]

    [![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/shrinathsnayak/cloudflare-experiments/tree/main/apps/experiments/webhook-relay-inspector)
  </Step>

  <Step>
    ### Configure bindings [#configure-bindings]

    Durable Object `RELAY` / `WebhookRelay` with migration in `wrangler.json`.
  </Step>

  <Step>
    ### Test your deployment [#test-your-deployment]

    See the experiment README for curl examples.
  </Step>
</Steps>

## Local Development [#local-development]

```bash
cd apps/experiments/webhook-relay-inspector
npm install
npm run dev
```

## Configuration [#configuration]

Durable Object `RELAY` / `WebhookRelay` with migration in `wrangler.json`.

## Cloudflare Features Used [#cloudflare-features-used]

* **[Durable Objects](https://developers.cloudflare.com/durable-objects/)**
* **[Workers](https://developers.cloudflare.com/workers/)**
