Docs
Node SDK

webhooks.deliveries.replay

Replay a webhook delivery in the authenticated project environment.

Import and client

TypeScript
import { RelayServer } from '@relayrtc/node'
 
const relay = new RelayServer({
  apiUrl: process.env.RELAYRTC_API_URL!,
  apiKey: process.env.RELAYRTC_SECRET_KEY!,
})

Requirements

A secret key with webhooks:write. The requested resource must belong to that key's project environment.

Parameters

OptionTypeDefault / requirementPurpose
endpointIdstringRequiredID returned when creating the webhook.
deliveryIdstringRequiredID of a delivery for this endpoint.
expectedReplayCountintegerRequiredThe current replayCount, from 0 to 99.
projectIdstringKey projectMust match the key's project.
environmentIdstringKey environmentMust match the key's environment.

Every method accepts RequestOptions as its final argument. Optional scope parameters go before RequestOptions. They cannot expand the key’s project or environment.

Example

TypeScript
const endpointId = 'webhook_example'
const deliveryId = 'delivery_example'
const delivery = await relay.webhooks.deliveries.get(endpointId, deliveryId)
const result = await relay.webhooks.deliveries.replay(endpointId, deliveryId, { expectedReplayCount: delivery.replayCount })

Returns

Promise<WebhookDelivery>. Returns the queued delivery, including its incremented replayCount.

Behavior

The endpoint must be enabled. The delivery must be succeeded, failed or cancelled and have the expected replay count. Conflicts return 409. Replay preserves event and delivery IDs and starts a new retry budget.

Replay can repeat side effects

Your receiver must deduplicate by event ID. There are at most 100 explicit replays per delivery.

REST equivalent

POST /v1/webhooks/{endpointId}/deliveries/{deliveryId}/replay. Failures throw RelayApiError.