Generate your Webhook Reference
Similar to API References, Fern Docs can automatically generate your Webhook Reference documentation from your API definition.
Fern supports webhooks through:
- OpenAPI 3.1+: Use the native
webhooks
field with anoperationId
(recommended) - OpenAPI 3.0: Use the
x-fern-webhook: true
extension - Fern Definition: Define
webhooks
in your specification
For more information on how to define webhooks, see:
Example:
For a real-world example of webhook documentation generated from an API definition, check out Webflow’s Webhooks.
Directory Structure
Your webhooks should be defined in a dedicated folder within your Fern project:
OpenAPI
Fern Definition
If you’re using OpenAPI, your generators.yml
file should point to your OpenAPI specification:
You can read more about how to define webhooks in your OpenAPI specification here.
Include more than one Webhook Reference
To include multiple webhook definitions in your documentation, use the webhook-name
property:
When using multiple webhook definitions, organize them in separate directories within your Fern project: