Skip to content

Contentful Webhook Not Triggering Fix

DodaTech Updated 2026-06-24 4 min read

In this tutorial, you'll learn about Contentful Webhook Not Triggering Fix. We cover key concepts, practical examples, and best practices.

The Problem

A Contentful webhook does not fire when content is published or updated. The webhook URL is configured but the receiving server never gets a POST request.

Quick Fix

Step 1: Verify the webhook URL is correct and accessible

# Test the webhook endpoint
curl -X POST https://your-server.com/webhook/contentful \
    -H "Content-Type: application/json" \
    -d '{"test": true}'

Expected output: The server responds with 200 OK.

Step 2: Check webhook logs in Contentful

Contentful Dashboard → Settings → Webhooks → Select webhook → Logs tab

Look for failed deliveries with HTTP status codes:

  • 200 — success
  • 4xx — server rejected the request
  • 5xx — server error
  • ECONNREFUSED — server not reachable
  • ETIMEDOUT — request timed out

Expected output: Webhook logs show delivery attempts and responses.

Step 3: Select the correct content type events

{
    "topics": [
        // Wrong — no events selected
        // Right — select specific events
        "ContentManagement.Entry.publish",
        "ContentManagement.Entry.unpublish",
        "ContentManagement.Entry.delete]
    ]
}

Configure the webhook to trigger on specific events:

  • Entry.publish — content is published
  • Entry.unpublish — content is unpublished
  • Entry.delete — content is deleted
  • Asset.publish — assets are published

Expected output: The webhook triggers on the selected events.

Step 4: Check for SSL/TLS issues

# Test SSL handshake
curl -v https://your-server.com/webhook/contentful

If the SSL certificate is self-signed or expired, Contentful rejects the connection:

# Use a valid SSL certificate from Let's Encrypt or a trusted CA
sudo certbot --nginx -d your-server.com

Expected output: The SSL handshake succeeds with a trusted certificate.

Step 5: Test with Contentful's webhook testing tool

# Use the "Test" button in Contentful webhook settings
# This sends a sample payload to test the connection

Expected output: The test result shows whether the delivery succeeded.

Step 6: Handle webhook retries

Contentful retries failed webhooks up to 3 times with exponential backoff:

Retry 1: after 10 seconds
Retry 2: after 60 seconds
Retry 3: after 300 seconds

Ensure your server responds within 30 seconds. If the server takes longer, Contentful times out.

Step 7: Add webhook authentication

// Server-side verification (Node.js example)
const crypto = require('crypto');

function verifyWebhook(req, res, next) {
    const signature = req.headers['x-contentful-webhook-signature'];
    const body = JSON.stringify(req.body);
    const expected = crypto
        .createHmac('sha256', process.env.CONTENTFUL_WEBHOOK_SECRET)
        .update(body)
        .digest('hex');

    if (signature !== expected) {
        return res.status(401).send('Invalid signature');
    }
    next();
}

Expected output: Only verified webhook requests are processed.

Step 8: Check for IP allowlisting

If your server has IP allowlisting, add Contentful's webhook IPs:

Contentful webhook IPs:
52.58.254.190
52.57.138.38
18.156.100.214

Expected output: Contentful can reach your server through the firewall.

Prevention

  • Test webhook endpoints with curl before configuring in Contentful
  • Use a valid SSL certificate from a trusted CA
  • Respond to webhook requests within 30 seconds
  • Monitor webhook logs for failed deliveries

Common Mistakes with webhook

  1. Using foldl instead of foldl' causing stack overflow on large lists
  2. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  3. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable

These mistakes appear frequently in real-world CONTENTFUL code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does my webhook send duplicate requests?

Contentful sends webhooks for each event that matches the selected topics. If you select both "Entry.publish" and "Entry.save", publishing triggers two webhooks. Select only the events you need. Idempotent endpoints handle duplicates by checking a unique event ID in the payload.

Can I filter webhooks by specific content types?

Yes. In the webhook configuration, add a filter condition: fields.sys.contentType.sys.id = "article". The webhook only triggers when the specified content type is affected. This prevents unnecessary webhook calls for unrelated content changes.

How do I debug a webhook that returns 500?

Check your server logs for error details. The 500 error is from your server, not Contentful. Common causes: unhandled exceptions in the webhook handler, database connection failures, or malformed payload processing. Add error logging to your webhook endpoint.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro