Webhooks in the Fern Definition
In Fern, you can specify webhooks in your API definition. The webhooks will be included in both the generated SDKs and the API documentation.
Webhook definition
Each webhook defines:
- Method: The HTTP Method that the webhook will use (either
GETorPOST) - Headers: The headers that the webhook will send
- Payload: The schema of the webhook payload
Inlined payloads
You can inline the schema of the payload by doing the following:
Generate webhook reference
Fern Docs can automatically generate your webhook reference documentation from your definition. Set this up in your docs.yml file.
Your webhook reference can be a single documentation page:
Or you can configure individual documentation pages per webhook event:
For more information on how to configure your webhook reference in docs.yml, see Generate your webhook reference.
SDK verification utilities
Fern automatically generates webhook signature verification utilities in your SDKs based on your webhook definitions. For more information, see Webhook signature verification.