Skip to main content

Payload structure

All webhook payloads follow a consistent structure with two main sections:

Webhook metadata

The webhook object is included in all webhook payloads and contains:

Page webhook payloads

Data fields

Example: Page published

Example: Page deleted

Blog Post webhook payloads

Data fields

Example: Blog Post published

Blog post webhook payloads are intentionally lightweight, containing only the post slug and ID. To get the full post content, use the slug to fetch the complete post data from the ButterCMS API.

Fetching full post data

Collection item webhook payloads

Data fields

Example: collection item published

Fetching full collection item data

The itemid field contains the API path to fetch the specific item:

Localized content payloads

For organizations with localization enabled, the locale field indicates which locale triggered the event:

Default locale

When content in the default locale is changed, locale is null:

Specific locale

When content in a specific locale is changed, locale contains the locale code:

Handling localized webhooks

Parsing webhook payloads

TypeScript interface

Define types for webhook payloads to ensure type safety:

Event type detection