Resend deliveries

Manually re-deliver failed webhook events — optionally to a different endpoint.

Resend webhook deliveries

One call, two ways to say WHICH deliveries. The simple way: pass a query — endpoint, event type, time window — and the server finds every failed delivery that matches and re-posts it (newest first, up to limit). The precise way: pass exact deliveries pairs when you already know them. Each accepted delivery is re-sent exactly once in the background — manual resends never enter the automatic retry schedule — and lands as a new manual attempt in the delivery history. Pass target_webhook_id with either mode to redirect every resend to another endpoint of your account (for example, after replacing a broken receiver).

POST /v3/webhooks/deliveries/resend

No listing, no pair-building: describe the failures and the server does the rest. All filters are optional — an empty query: {} means "every failed delivery of the last 24 hours, on any endpoint".

query object
ParameterTypeRequiredDescription
webhook_idUUIDOptionalOnly deliveries to this endpoint. Omit to cover every endpoint of your account.
eventstringOptionalOnly deliveries of this event type — e.g. bounced, delivered, complained.
sinceISO-8601OptionalWindow start. Default: 24 hours ago; reaches at most 90 days back.
untilISO-8601OptionalWindow end. Default: now.
limitintegerOptionalResend at most this many (newest first), 1–100. Default 100. When has_more is true in the response, repeat the same call to drain the rest.

Resend exact deliveries (advanced)

ParameterTypeRequiredDescription
deliveriesarrayOptional1–100 items of { webhook_id, event_id } — for when you already know exactly which deliveries to re-post. Provide either deliveries OR query, never both.
target_webhook_idUUIDOptionalWorks with both modes. Redirect: post every resend to this endpoint of your account instead of each delivery’s original endpoint. Must be an enabled endpoint; the redirect (source endpoint + time) is recorded on the delivery history and in the audit trail.

Eligibility

Only deliveries whose latest attempt is failed are resendable, and only real event deliveries — endpoint-test attempts have no source event and are skipped. Everything else is reported back with a reason: not_failed (latest attempt succeeded or is still retrying), not_found (no such delivery in the last 90 days), or locked (the same delivery was already submitted within the last 60 seconds — duplicate submissions are deduplicated).

Replay markers

Every resent delivery carries two extra request headers so your receiver can deduplicate safely when the original was actually processed before an outage: X-Wemail-Replay: true (present only on manual resends — organic first deliveries and automatic retries never send it) and X-Wemail-Delivery-Id: <event_id> — the source event id, stable across every replay of the same delivery and identical to the event_id you pass to this endpoint. The X-Webhook-Attempt header keeps counting from the delivery’s existing history (a first resend after 3 failed tries arrives as attempt 4).

Retention

Resend reaches up to 90 days back, bounded by your plan’s delivery-history retention: 30 days on Free, 12 months on paid plans — the same window as events and the Console Activity grid.

Responses

StatusDescription
200OK. { results: [{ webhook_id, event_id, accepted, reason }], accepted_count, skipped_count, matched_count, has_more } — per-delivery acceptance detail; has_more (query mode) means more matches exist beyond limit, so repeat the call.
400Validation error — malformed body, or target_webhook_id is not an enabled endpoint of your account.
401Missing or invalid API key.
429Rate limit exceeded (30 calls/minute).

Code examples

cURL
# Resend two failed deliveries, redirected to a backup endpoint
curl -X POST https://api.wemail.io/v3/webhooks/deliveries/resend \
  -H "Authorization: Bearer afn_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "deliveries": [
      { "webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", "event_id": "evt_01J8ZQ3K9WVA7M2P" },
      { "webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", "event_id": "evt_01J8ZQ4T2XNC8R5D" }
    ],
    "target_webhook_id": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
  }'
Node.js
import { WemailClient } from "@wemailio/sdk";
const wemail = new WemailClient(process.env.WEMAIL_API_KEY);

// Resend failed deliveries — here redirected to a backup endpoint
// of the same account. Only failed deliveries are eligible.
const { results } = await wemail.webhooks.resendWebhookDeliveries({
  resendWebhookDeliveriesRequest: {
    deliveries: [
      { webhookId: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", eventId: "evt_01J8ZQ3K9WVA7M2P" },
      { webhookId: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", eventId: "evt_01J8ZQ4T2XNC8R5D" },
    ],
    targetWebhookId: "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
  },
});
for (const r of results) console.log(r.eventId, r.accepted, r.reason);
Python
import os
from wemail import WemailClient, ResendWebhookDeliveriesRequest

wemail = WemailClient(api_key=os.environ["WEMAIL_API_KEY"])

result = wemail.webhooks.resend_webhook_deliveries(
    ResendWebhookDeliveriesRequest.from_dict({
        "deliveries": [
            {"webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", "event_id": "evt_01J8ZQ3K9WVA7M2P"},
            {"webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", "event_id": "evt_01J8ZQ4T2XNC8R5D"},
        ],
        "target_webhook_id": "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
    })
)
for r in result.results:
    print(r.event_id, r.accepted, r.reason)
PHP
<?php
$wemail = new \Wemail\WemailClient(getenv('WEMAIL_API_KEY'));
$result = $wemail->webhooks()->resendWebhookDeliveries(
    new \Wemail\Sdk\Model\ResendWebhookDeliveriesRequest([
        'deliveries' => [
            ['webhook_id' => '9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c', 'event_id' => 'evt_01J8ZQ3K9WVA7M2P'],
            ['webhook_id' => '9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c', 'event_id' => 'evt_01J8ZQ4T2XNC8R5D'],
        ],
        'target_webhook_id' => '4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f',
    ])
);
Ruby
wemail = Wemail::Client.new(api_key: ENV["WEMAIL_API_KEY"])
result = wemail.webhooks.resend_webhook_deliveries(
  Wemail::ResendWebhookDeliveriesRequest.new(
    deliveries: [
      { webhook_id: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", event_id: "evt_01J8ZQ3K9WVA7M2P" },
      { webhook_id: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", event_id: "evt_01J8ZQ4T2XNC8R5D" }
    ],
    target_webhook_id: "4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
  )
)
Go
client, _ := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
// Generated layer (client.API.*): pass the key in the context.
ctx := context.WithValue(context.Background(), wemail.ContextAccessToken, os.Getenv("WEMAIL_API_KEY"))
res, _, err := client.API.WebhooksAPI.ResendWebhookDeliveries(ctx).
    ResendWebhookDeliveriesRequest(wemail.ResendWebhookDeliveriesRequest{
        Deliveries: []wemail.ResendWebhookDeliveriesRequestDeliveriesInner{
            {WebhookId: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", EventId: "evt_01J8ZQ3K9WVA7M2P"},
            {WebhookId: "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c", EventId: "evt_01J8ZQ4T2XNC8R5D"},
        },
        TargetWebhookId: wemail.PtrString("4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f"),
    }).Execute()
for _, r := range res.Results {
    fmt.Println(r.EventId, r.Accepted)
}
Java
WemailClient wemail = new WemailClient(System.getenv("WEMAIL_API_KEY"));
WebhookResendResult res = wemail.webhooks().resendWebhookDeliveries(new ResendWebhookDeliveriesRequest()
    .deliveries(List.of(
        new ResendWebhookDeliveriesRequestDeliveriesInner()
            .webhookId(UUID.fromString("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c")).eventId("evt_01J8ZQ3K9WVA7M2P"),
        new ResendWebhookDeliveriesRequestDeliveriesInner()
            .webhookId(UUID.fromString("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c")).eventId("evt_01J8ZQ4T2XNC8R5D")))
    .targetWebhookId(UUID.fromString("4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f")));
System.out.println(res.getAcceptedCount() + " accepted");
.NET
var wemail = new WemailClient(Environment.GetEnvironmentVariable("WEMAIL_API_KEY"));
var res = await wemail.Webhooks.ResendWebhookDeliveriesAsync(new ResendWebhookDeliveriesRequest(
  deliveries: new List<ResendWebhookDeliveriesRequestDeliveriesInner> {
    new ResendWebhookDeliveriesRequestDeliveriesInner(Guid.Parse("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c"), "evt_01J8ZQ3K9WVA7M2P"),
    new ResendWebhookDeliveriesRequestDeliveriesInner(Guid.Parse("9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c"), "evt_01J8ZQ4T2XNC8R5D"),
  },
  targetWebhookId: Guid.Parse("4c1d2e3f-5a6b-4c7d-8e9f-0a1b2c3d4e5f")));
Console.WriteLine(
quot;{res.AcceptedCount} accepted");
ResponseExample response
{
  "results": [
    {
      "webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c",
      "event_id": "evt_01J8ZQ3K9WVA7M2P",
      "accepted": true,
      "reason": null
    },
    {
      "webhook_id": "9b2f6c1e-4a8d-4f3b-9c7e-2d1a5b8e0f4c",
      "event_id": "evt_01J8ZQ4T2XNC8R5D",
      "accepted": false,
      "reason": "not_failed"
    }
  ]
}