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/f47ac10b-58cc-4372-a567-0e02b2c3d479/deliver' \
--header 'Authorization: Bearer YOUR_API_TOKEN'

Example response

{}

The endpoint returns an empty JSON object on success. The redelivery is processed asynchronously.

Response codes

CodeDescription
200Redelivery successfully queued for processing
401Unauthorized - Invalid or missing API token
404Webhook delivery not found
422Unprocessable Entity - Webhook configuration is disabled or deleted

Redelivery behavior

When you trigger a redelivery:

  1. Async processing: The redelivery is queued and processed in the background
  2. Same payload: The same webhook payload from the original delivery is resent
  3. New delivery record: A new webhook delivery record is NOT created - the system retries the delivery
  4. Fresh signature: A new X-Lia-Signature is generated for the redelivery attempt
  5. Timeout handling: The delivery will timeout after 30 seconds if your endpoint doesn’t respond

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, you can use the GET /webhook_deliveries/:id endpoint to check the updated delivery status and response.

Important notes

  • You can only redeliver webhooks for active webhook configurations
  • If the webhook configuration has been deleted or disabled, the redelivery will fail
  • There is no automatic retry mechanism - you must manually trigger redeliveries
  • Consider implementing exponential backoff if you need to retry multiple times

Example workflow

// Check delivery status
const delivery = await getWebhookDelivery('f47ac10b-58cc-4372-a567-0e02b2c3d479');

if (delivery.response_code !== 200) {
  console.log('Webhook delivery failed, redelivering...');
  
  // Trigger redelivery
  await redeliverWebhook('f47ac10b-58cc-4372-a567-0e02b2c3d479');
  
  // Wait a moment for processing
  await new Promise(resolve => setTimeout(resolve, 2000));
  
  // Check updated status
  const updatedDelivery = await getWebhookDelivery('f47ac10b-58cc-4372-a567-0e02b2c3d479');
  console.log('Redelivery status:', updatedDelivery.response_code);
}