Redeliver webhook

POST

POST https://external-api.lia.com.br/external_api/v1/webhook_deliveries/:id/deliver

This endpoint triggers a manual redelivery of a webhook that previously failed or needs to be resent. A new webhook delivery attempt will be created and sent to the configured webhook endpoint.

Path Parameters

NameDescriptionRequiredType
idWebhook delivery ID (UUID)trueString

Example request

curl --location --request POST 'https://external-api-sandbox.lia.com.br/external_api/v1/webhook_deliveries/5dd0674e-e214-582f-9749-0fec33963e50/deliver' \
--header 'Authorization: Bearer YOUR_API_TOKEN'

Example response

{}

The redelivery attempt is made during the request, and the endpoint returns an empty JSON object whether that attempt succeeded or not. If it fails, retries are scheduled automatically.

Response codes

CodeDescription
200Redelivery attempted
401Unauthorized - Invalid or missing API token
404Webhook delivery not found

Redelivery behavior

When you trigger a redelivery:

  1. Immediate attempt: The redelivery is sent during the request. If your endpoint answers with a non-2xx status or does not answer, it is retried automatically in the background, up to 14 attempts over at least 24 hours
  2. Same payload: The stored body of the original delivery is resent, to the webhook’s current URL and verb
  3. New delivery record: Each attempt that receives a response creates a new webhook delivery record; the original record is not changed
  4. Same signature: The original request headers, including X-Lia-Signature, are resent

Use cases

Use this endpoint to:

  • Retry failed deliveries: Manually resend webhooks that failed due to temporary endpoint issues
  • Test endpoints: Verify your webhook endpoint is working after fixing integration issues
  • Recovery: Resend webhooks after your service was down or experiencing issues
  • Development: Replay webhooks to your development environment for testing

After redelivering a webhook, list GET /webhook_deliveries?webhook_id=:webhook_id to see the new attempt; it is the newest record.

Important notes

  • Failed deliveries are already retried automatically (up to 14 attempts over at least 24 hours); use this endpoint when you need a delivery resent after that
  • Consider implementing exponential backoff if you need to retry multiple times

Example workflow

// Check delivery status
const delivery = await getWebhookDelivery('5dd0674e-e214-582f-9749-0fec33963e50');

if (delivery.response_code < 200 || delivery.response_code >= 300) {
  console.log('Webhook delivery failed, redelivering...');

  // Trigger redelivery (the attempt is made during this request)
  await redeliverWebhook('5dd0674e-e214-582f-9749-0fec33963e50');

  // The attempt is a new record: list the webhook's deliveries, newest first
  const { results } = await listWebhookDeliveries({ webhook_id: delivery.webhook_id });
  console.log('Redelivery status:', results[0].response_code);
}