This document describes how to update webhook snippet examples and the versions page when a new webhook schema version is released.
- Webhook example payloads live in
_snippets/webhooks/*.mdx. Each file contains a single JSON code block with an example payload for one webhook event type. - The webhook versions changelog lives in
webhooks/versions.mdx. - Snippets are validated against the latest schema at
https://core-api.uk.plain.com/webhooks/schema/latest.jsonusing thepnpm lint:snippetscommand (which runsscripts/validateWebhookSnippets.ts). - Versioned schemas are available at
https://core-api.uk.plain.com/webhooks/schema/<version>.json(e.g.2026-02-11.json).
Please update the documentation for webhook version
<version>
Fetch the JSON schemas for the new version and the previous version to diff them:
- New:
https://core-api.uk.plain.com/webhooks/schema/<new-version>.json - Previous: the most recent version listed in
webhooks/versions.mdx
Compare the two schemas and note:
- New fields added to existing definitions (e.g. a new field on
threadField,thread,customer,labelType, etc.) - Fields removed from existing definitions
- Type changes (e.g.
internalActor→actor, new enum values) - New event types added to the
typeenum or new payload definitions - Removed event types
pnpm lint:snippetsThis validates every file in _snippets/webhooks/ against the latest schema. Any failing snippets will be reported with the specific validation error (e.g. missing required field, wrong type).
Fix all reported errors before proceeding.
For each failing snippet in _snippets/webhooks/:
- Open the file and find the JSON payload inside the
```jsoncode block. - Cross-reference with the schema definition for that event type. The
eventTypefield in the payload tells you which schema definition to look at. - Common fixes:
- Missing required field: Add the field with an appropriate example value (use
nullfor nullable fields that don't apply to the example). - Wrong field names: Always check the schema for the correct field names. For example, each actor type has its own ID field — look up the relevant actor definition in the schema.
- New enum value: If a type enum was expanded, no snippet changes are usually needed unless an existing value was removed.
- Missing required field: Add the field with an appropriate example value (use
- When in doubt, fetch the schema and look up the
requiredarray for the relevant definition.
pnpm lint:snippetsConfirm all snippets pass. If any still fail, repeat step 4.
Add a new ### \` (Latest)section **above** the previous latest version. Remove the(Latest)` label from the old one.
Each version entry should include:
- A concise bulleted list of what changed (fields added/removed, type changes, new events)
- A link to the JSON schema:
[View JSON Schema](https://core-api.uk.plain.com/webhooks/schema/<version>.json)
Keep the descriptions brief — a few bullet points on fields/events added, removed, or changed.
Run the full linter one more time to make sure nothing is broken:
pnpm lint:snippets