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

# Redeliver Webhook Events to a Specific Subscription

> POST /v1/webhook-subscriptions/{id}/redeliver — Re-queues specific events or a time-window batch for redelivery. Supports up to 1,000 events per request.

This endpoint re-queues webhook events for delivery to a specific subscription. It is useful when your endpoint experienced downtime, returned errors, or you otherwise need to replay historical events. You can target specific event IDs directly, or use a time-window query with an optional status filter to reprocess events in bulk. Existing delivery attempt records are reset and immediate delivery is triggered for all matched events.

> [!NOTE]
>
> A maximum of **1,000 events** can be redelivered per request. If your query matches more than 1,000 events, only the first 1,000 will be redelivered. Use narrower time windows or specific event IDs to stay within this limit.

## Endpoint

```
POST /v1/webhook-subscriptions/{id}/redeliver
```

**Required scope:** `webhooks.write`

## Request Headers

| Header | Required | Description |
| - | - | - |
| `Authorization` | Yes | `Bearer {access_token}` |
| `x-idempotency-key` | Yes | A UUID v4 that makes this request safe to retry |
| `Content-Type` | Yes | `application/json` |

## Path Parameters

**id** `string` *required*

The UUID of the webhook subscription to redeliver events to.

## Request Body

The request body contains a single `payload` object. Two delivery modes are supported:

**payload** `object` *required*

Describes which events to redeliver and how to select them.

**payload fields**

**payload.mode** `string` *required*

Delivery mode. Must be `"specific"` or `"query"`.

**When `mode` is `"specific"`:**

**payload.eventIds** `array`

An array of event UUIDs to redeliver. Maximum **100** event IDs per request.

**When `mode` is `"query"`:**

**payload.from** `string`

ISO 8601 start of the time window. Events created at or after this timestamp will be matched.

**payload.to** `string`

ISO 8601 end of the time window. Events created at or before this timestamp will be matched. The window between `from` and `to` cannot exceed **7 days**.

**payload.status** `string`

Filter events by delivery status within the time window. Accepted values:

* `FAILED` — all retry attempts have been exhausted without a successful delivery.
* `NOT_DELIVERED` — the event has not yet been successfully delivered (includes events still in retry queue).

## Response — 200 OK

**subscriptionId** `string`

UUID of the webhook subscription events are being redelivered to.

**totalMatched** `integer`

The total number of events matched by the request (before the 1,000-event cap is applied).

**redeliveredCount** `integer`

The number of events that were actually queued for redelivery (capped at 1,000).

## Examples

### Mode 1 — Redeliver specific events by ID

```bash theme={null}
curl --request POST \
  --url https://api.diameterpay.com/v1/webhook-subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/redeliver \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency-key: e8f0a2b4-c6d8-4e0f-a2b4-c6d8e0f2a4b6' \
  --data '{
    "payload": {
      "mode": "specific",
      "eventIds": [
        "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "c3d4e5f6-a7b8-9012-cdef-123456789012"
      ]
    }
  }'
```

### Mode 2 — Redeliver all failed events in a time window

```bash theme={null}
curl --request POST \
  --url https://api.diameterpay.com/v1/webhook-subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/redeliver \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency-key: f9a1b3c5-d7e9-5f1a-b3c5-d7e9f1a3b5c7' \
  --data '{
    "payload": {
      "mode": "query",
      "from": "2024-06-01T00:00:00Z",
      "to": "2024-06-07T23:59:59Z",
      "status": "FAILED"
    }
  }'
```

### Mode 2 — Redeliver all undelivered events in a time window (no status filter)

```bash theme={null}
curl --request POST \
  --url https://api.diameterpay.com/v1/webhook-subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/redeliver \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency-key: 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d' \
  --data '{
    "payload": {
      "mode": "query",
      "from": "2024-06-10T14:00:00Z",
      "to": "2024-06-10T16:00:00Z",
      "status": "NOT_DELIVERED"
    }
  }'
```

### Response

```json theme={null}
{
  "subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "totalMatched": 47,
  "redeliveredCount": 47
}
```

## Delivery Behavior

* Redelivery is asynchronous — the API confirms queuing, not successful delivery.
* Existing retry counters are reset; events are treated as new deliveries.
* Diameter will attempt delivery immediately, followed by exponential backoff if your endpoint does not return a `2xx` status.
* If `totalMatched` exceeds `1,000`, submit additional requests using narrower time windows or smaller batches of event IDs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.