# `inspect_inbox_events` — Inspect Captured Webhook Events

> Part of [HookSink Webhook Inbox & Signature Verifier API](https://hook-sink.apikeg.com/llms.txt) (`com.apikeg/hook-sink`)

Retrieves captured webhook deliveries from an inbox (headers, raw body, SHA-256 digest, parsed JSON, and cryptographic signature verification), supporting cursor pagination via sinceEventId and retroactive ad-hoc signature checks.

**Why call instead of DIY:** Provides structured raw-body + parsed-JSON payloads with constant-time HMAC verification in a single call.

- **REST Endpoint:** `POST https://hook-sink.apikeg.com/v1/inspect-inbox-events`
- **MCP Server:** `https://hook-sink.apikeg.com/mcp` (tool: `inspect_inbox_events`)
- **Pricing:** $0.002 USD per inbox inspection query (x402 instant micropayment)
- **Free Dry-Run:** `POST https://hook-sink.apikeg.com/v1/inspect-inbox-events?dry_run=true`

## Input JSON Schema
```json
{
  "type": "object",
  "properties": {
    "inboxId": {
      "type": "string",
      "minLength": 4,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_-]+$",
      "description": "Ephemeral inbox identifier returned by create_inbox."
    },
    "readToken": {
      "type": "string",
      "minLength": 8,
      "maxLength": 256,
      "description": "Secret read token returned by create_inbox."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 50,
      "description": "Maximum number of captured webhook events to return (1–100, default 50)."
    },
    "sinceEventId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "Cursor pagination: return only events captured strictly after this eventId."
    },
    "signingSecret": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "description": "Optional ad-hoc HMAC signing secret to retroactively verify captured webhook events."
    },
    "provider": {
      "type": "string",
      "enum": [
        "auto",
        "stripe",
        "github",
        "shopify",
        "slack",
        "linear",
        "generic_sha256"
      ],
      "description": "Optional provider preset override for retroactive signature verification (auto, stripe, github, shopify, slack, linear, generic_sha256)."
    },
    "signatureHeader": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "Optional custom header name for retroactive generic_sha256 verification."
    },
    "toleranceSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 86400,
      "description": "Optional timestamp tolerance window in seconds (evaluated against each event's receivedAt timestamp)."
    }
  },
  "required": [
    "inboxId",
    "readToken"
  ],
  "additionalProperties": false
}
```

## Examples
### Inspect latest webhook deliveries
```bash
curl -X POST "https://hook-sink.apikeg.com/v1/inspect-inbox-events" \
  -H "Content-Type: application/json" \
  -d '{"inboxId":"inb_0123456789abcdef01234567","readToken":"hsk_0123456789abcdef0123456789abcdef0123456789abcdef","limit":20}'
```
