Skip to content

mv.webhookDeliveries

Delivery attempts of events to your endpoints. These methods are on mv.webhookDeliveries, where mv is your client (see the Node.js SDK). Each one returns the response object and throws when the API answers with an error.

List webhook deliveries. Deliveries of events to your endpoints in this mode, newest first. Filter by endpoint, event or status (status=failed for the ones being retried). Kept 30 days.

mv.webhookDeliveries.list(query?: NonNullable<WebhookDeliveriesListData["query"]>, options?: RequestOptions): PagedList<WebhookDeliveriesListResponse["data"][number], NonNullable<WebhookDeliveriesListData["query"]>>

GET /webhook_deliveries · API reference

Name Type Required Description
query.limit integer no How many objects to return, 1–100 (default 20).
query.starting_after string no A cursor (next_cursor) or object ID: return the objects after it (older).
query.ending_before string no A cursor or object ID: return the objects before it (newer).
query.endpoint_id string no A webhook endpoint ID (we_…).
query.event_id string no A event ID (evt_…).
query.status string no
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

A PagedList: await it for the first page, for await it for every item.

import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
for await (const webhookDelivery of mv.webhookDeliveries.list()) {
console.log(webhookDelivery);
}

Retrieve a webhook delivery. The delivery with the request as last sent (headers without the signatures, the exact body) and the start of the endpoint’s answer.

mv.webhookDeliveries.retrieve(id: WebhookDeliveriesRetrieveData["path"]["id"], options?: RequestOptions): Promise<WebhookDeliveriesRetrieveResponse>

GET /webhook_deliveries/{id} · API reference

Name Type Required Description
id string yes A webhook delivery ID (whd_…).
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

WebhookDelivery:

Field Type Description
id string A webhook delivery ID (prefix whd_).
object "webhook_delivery" Always webhook_delivery.
endpoint_id string A webhook endpoint ID (prefix we_).
event_id string A event ID (prefix evt_).
event_type string | null —
status "pending" | "failed" | "succeeded" | "dead" pending: not sent yet. failed: the last attempt failed; retried at next_attempt_at (for up to 72 hours). succeeded: answered 2xx. dead: given up.
attempts integer —
next_attempt_at string | null —
last_attempt_at string | null —
delivered_at string | null —
response_status integer | null —
response_excerpt string | null The first 2 KB of the endpoint’s last answer.
duration_ms integer | null How long the last attempt took.
error string | null —
livemode boolean true in live mode, false in test mode.
created string An ISO-8601 timestamp in UTC.
request object The request as last sent (retrieve only).
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const webhookDelivery = await mv.webhookDeliveries.retrieve("whd_7Hk2Lm9Qp");
console.log(webhookDelivery);

Retry a webhook delivery. Sends the delivery again right now (a dead one too) and returns it with the outcome. A retry that fails leaves a dead delivery dead; a delivery still being retried keeps its schedule.

mv.webhookDeliveries.retry(id: WebhookDeliveriesRetryData["path"]["id"], options?: RequestOptions): Promise<WebhookDeliveriesRetryResponse>

POST /webhook_deliveries/{id}/retry · API reference

Name Type Required Description
id string yes A webhook delivery ID (whd_…).
options.headers["MoreVoice-Version"] string no The API version to use for this request. Defaults to the version the API key is pinned to.
options.headers["Idempotency-Key"] string no A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice.
options RequestOptions no idempotencyKey, extra headers and an abort signal: see retries and idempotency.

WebhookDelivery:

Field Type Description
id string A webhook delivery ID (prefix whd_).
object "webhook_delivery" Always webhook_delivery.
endpoint_id string A webhook endpoint ID (prefix we_).
event_id string A event ID (prefix evt_).
event_type string | null —
status "pending" | "failed" | "succeeded" | "dead" pending: not sent yet. failed: the last attempt failed; retried at next_attempt_at (for up to 72 hours). succeeded: answered 2xx. dead: given up.
attempts integer —
next_attempt_at string | null —
last_attempt_at string | null —
delivered_at string | null —
response_status integer | null —
response_excerpt string | null The first 2 KB of the endpoint’s last answer.
duration_ms integer | null How long the last attempt took.
error string | null —
livemode boolean true in live mode, false in test mode.
created string An ISO-8601 timestamp in UTC.
request object The request as last sent (retrieve only).
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const webhookDelivery = await mv.webhookDeliveries.retry("whd_7Hk2Lm9Qp");
console.log(webhookDelivery);