> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aioka.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook Delivery History

> Returns the last 50 delivery attempts for a specific webhook subscription.

## Overview

Returns up to 50 of the most recent delivery attempts for a webhook subscription. Use this to debug failed deliveries and inspect HMAC signatures.

**Tier:** Basic 🔒
**Rate limit:** 60/minute

## Path Parameters

<ParamField path="id" type="string" required>
  UUID of the webhook subscription.
</ParamField>

## Response

<ResponseField name="webhook_id" type="string">
  UUID of the webhook subscription.
</ResponseField>

<ResponseField name="deliveries" type="array">
  Array of delivery attempt objects, newest first.

  <Expandable title="Delivery object">
    <ResponseField name="delivered_at" type="string">
      ISO 8601 timestamp of the delivery attempt.
    </ResponseField>

    <ResponseField name="event_type" type="string">
      The event type delivered (e.g. `verdict.new`, `ghost.signal`).
    </ResponseField>

    <ResponseField name="status_code" type="integer">
      HTTP status code returned by your endpoint. `null` if the request never reached your server.
    </ResponseField>

    <ResponseField name="success" type="boolean">
      `true` if the endpoint returned 2xx, `false` otherwise.
    </ResponseField>

    <ResponseField name="attempt" type="integer">
      Attempt number (1 = first try, up to 3 retries with exponential backoff).
    </ResponseField>

    <ResponseField name="response_ms" type="integer">
      Round-trip latency in milliseconds. `null` on network failure.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="count" type="integer">
  Number of delivery records returned (max 50).
</ResponseField>

## HMAC Verification

Every delivery includes an `X-AIOKA-Signature` header. Verify it on your server:

```python theme={null}
import hmac, hashlib

def verify(secret: str, payload: bytes, signature: str) -> bool:
    expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)
```

## Retry Policy

Failed deliveries are retried up to 3 times with exponential backoff: **5s → 25s → 125s**. After 10 consecutive failures the subscription is automatically disabled.

<RequestExample>
  ```bash theme={null}
  curl https://api.aioka.io/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6/deliveries \
    -H "X-API-Key: aik_basic_..."
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "webhook_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "deliveries": [
      {
        "delivered_at": "2026-04-18T14:32:10Z",
        "event_type": "verdict.new",
        "status_code": 200,
        "success": true,
        "attempt": 1,
        "response_ms": 143
      },
      {
        "delivered_at": "2026-04-18T14:01:55Z",
        "event_type": "ghost.signal",
        "status_code": 503,
        "success": false,
        "attempt": 3,
        "response_ms": 5012
      }
    ],
    "count": 2
  }
  ```
</ResponseExample>
