High severity intermediate · Fix: 5-10 min

WebhookDeliveryFailedError

replicate.errors.WebhookDeliveryFailedError

What this error means
Replicate's webhook delivery failed error occurs when the callback URL does not acknowledge or respond properly to webhook POST requests.

Stack trace

traceback
replicate.errors.WebhookDeliveryFailedError: Webhook delivery failed with status code 500 for URL https://example.com/webhook
    at replicate.client._send_webhook (replicate/client.py:123)
    at replicate.client._handle_event (replicate/client.py:98)
    at replicate.client.poll (replicate/client.py:75)
QUICK FIX
Ensure your webhook URL is correct, publicly accessible, and returns HTTP 200 OK quickly to fix delivery failures immediately.

Why it happens

This error happens when the webhook endpoint URL configured in Replicate is unreachable, returns an error status (like 500), or times out. Replicate expects a 2xx HTTP response to confirm successful delivery. Network issues, server errors, or misconfigured endpoints cause this failure.

Detection

Monitor webhook delivery logs in Replicate dashboard or catch WebhookDeliveryFailedError exceptions in your webhook handling code to log failed deliveries and response codes.

Causes & fixes

1

Webhook endpoint URL is incorrect or unreachable

✓ Fix

Verify the webhook URL is correct, publicly accessible, and not blocked by firewalls or IP restrictions.

2

Webhook endpoint returns HTTP 5xx or 4xx error

✓ Fix

Fix server-side errors or authentication issues on the webhook endpoint to ensure it returns HTTP 200 OK on valid requests.

3

Webhook endpoint times out or is too slow to respond

✓ Fix

Optimize webhook handler performance or increase timeout settings to respond promptly within Replicate's webhook timeout window.

4

Webhook endpoint requires authentication but none is provided

✓ Fix

Configure Replicate webhook settings to include necessary authentication headers or tokens, or disable auth if not needed.

Code: broken vs fixed

Broken - triggers the error
python
import os
from replicate import Client

client = Client(api_token=os.environ['REPLICATE_API_TOKEN'])

# This triggers webhook delivery failure if URL is wrong or endpoint errors
client.models.get("some-model").predict(input="test")  # webhook fails here
Fixed - works correctly
python
import os
from replicate import Client

client = Client(api_token=os.environ['REPLICATE_API_TOKEN'])

# Fixed: Ensure webhook URL is correct and endpoint returns 200 OK
client.models.get("some-model").predict(input="test")  # webhook succeeds if endpoint fixed
print("Webhook delivery succeeded")
Verified webhook endpoint correctness and responsiveness to ensure Replicate receives HTTP 200 OK, preventing delivery failures.

Workaround

Catch WebhookDeliveryFailedError exceptions and implement retry logic with exponential backoff or fallback to polling model status instead of relying solely on webhooks.

Prevention

Use reliable, monitored webhook endpoints with health checks and logging. Prefer secure, authenticated URLs and handle retries gracefully to avoid webhook delivery failures.

Python 3.7+ · replicate >=0.5.0 · tested on 0.6.0
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.