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
GET
orPOST
) - Headers: The headers that the webhook will send
- Payload: The schema of the webhook payload
webhooks.yml
Inlined payloads
You can inline the schema of the payload by doing the following:
webhooks.yml
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:
docs.yml
Or you can configure individual documentation pages per webhook event:
docs.yml
For more information on how to configure your webhook reference in docs.yml
, see Generate your webhook reference.