Skip to main content

How webhooks work

  1. Configure Endpoints: Set up webhook URLs in your ButterCMS account settings
  2. Choose Events: Select which content events should trigger notifications
  3. Receive Notifications: ButterCMS sends HTTP POST requests to your endpoints
  4. Process Changes: Your application processes the webhook payload and takes action

What is a webhook?

Webhooks are automated messages or notifications sent from apps to a specified destination when an event occurs or is triggered. Unlike traditional APIs that require you to poll for updates, webhooks push data to you when something happens. Diagram showing the difference between webhooks and APIs To use a real-world example, an API is like calling your favorite store to ask if they have a specific product available. If the answer is “no,” you might end up repeatedly calling to get an update. Webhooks, however, are like saying, “call me when you have them in stock.” This process saves time for both parties.

Key benefits of webhooks

BenefitDescription
Real-Time UpdatesReceive instant notifications when content changes, eliminating the need for polling
Reduced API CallsOnly fetch data when something actually changes, saving bandwidth and resources
Event-Driven ArchitectureBuild reactive systems that respond immediately to content events
Automation ReadyTrigger automated workflows like deployments, notifications, or integrations
LightweightSimple HTTP POST requests with JSON payloads are easy to process

ButterCMS Webhook Events

ButterCMS supports webhooks for all major content types — pages, blog posts, collection items, and media. See Event Types Reference for the complete list of available events.

Common use cases

Real-time cache invalidation

Clear CDN cache when content updates. When a page is published, automatically purge the cached version so users see the latest content immediately.

Multi-channel publishing

Sync content to social media, email lists, and mobile apps. When a new blog post is published, automatically share it across your channels.

Automated workflows

Trigger deployments or notifications on content changes. Rebuild your static site when content is updated, or notify your team when content is ready for review.

Email marketing integration

There are many use cases where integrating ButterCMS with your Email Service Provider can help boost your marketing campaigns:
  • Notifying your audience of new content with an automated content workflow—no more manual grunt work
  • Automated newsletters using ButterCMS webhooks to create weekly/biweekly/monthly newsletters to keep your audience engaged
  • Team notifications about changes to your ButterCMS content
Illustration of webhook notifications

Webhook architecture

The workflow is straightforward:
  1. Content changes in ButterCMS trigger an event
  2. ButterCMS sends an HTTP POST request to your configured endpoint
  3. Your server receives the webhook payload with event details
  4. Your application processes the payload and takes appropriate action

Locale support

For organizations with localization enabled, webhooks include a locale field when events occur for specific locales. The locale field is null for content in the organization’s default locale. This allows you to take locale-specific actions, such as:
  • Invalidating only the cache for a specific language
  • Triggering region-specific notifications
  • Updating locale-specific search indexes

Getting started

Ready to set up webhooks for your ButterCMS project? Here’s what you’ll need:
  1. A publicly accessible endpoint to receive webhook requests
  2. HTTPS support for secure data transmission
  3. Quick response times (within 5 seconds) to avoid timeouts