Skip to content

Commit 8cb398e

Browse files
authored
Add webhooks section to OpenAPI setup (#894)
* add webhooks section * put version requirements in context
1 parent 3eb582f commit 8cb398e

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

api-playground/openapi-setup.mdx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Reference OpenAPI endpoints in your docs pages"
44
icon: "file-json"
55
---
66

7-
OpenAPI is a specification for describing REST APIs. Mintlify supports OpenAPI 3.0+ documents to generate interactive API documentation and keep it up to date.
7+
OpenAPI is a specification for describing APIs. Mintlify supports OpenAPI 3.0+ documents to generate interactive API documentation and keep it up to date.
88

99
## Add an OpenAPI specification file
1010

@@ -186,8 +186,6 @@ version: "version-string" (not required)
186186

187187
<Note>
188188
The method and path must exactly match the definition in your OpenAPI specification. If the endpoint doesn't exist in the OpenAPI file, the page will be empty.
189-
190-
For webhooks, use `webhook` (case insensitive) instead of the HTTP method (like `GET` or `POST`) in your reference.
191189
</Note>
192190

193191
### Autogenerate `MDX` files
@@ -239,3 +237,29 @@ openapi-schema: "schema-key"
239237
```
240238

241239
</CodeGroup>
240+
241+
## Webhooks
242+
243+
Webhooks are HTTP callbacks that your API sends to notify external systems when events occur. Webhooks are supported in OpenAPI 3.1+ documents.
244+
245+
### Define webhooks in your OpenAPI specification
246+
247+
Add a `webhooks` field to your OpenAPI document alongside the `paths` field.
248+
249+
For more information on defining webhooks, see [Webhooks](https://spec.openapis.org/oas/v3.1.0#oasWebhooks) in the OpenAPI documentation.
250+
251+
### Reference webhooks in MDX files
252+
253+
When creating MDX pages for webhooks, use `webhook` instead of HTTP methods like `GET` or `POST`:
254+
255+
```mdx
256+
---
257+
title: "Example webhook"
258+
description: "Triggered when an event occurs"
259+
openapi: "path/to/openapi-file webhook example-webhook-name"
260+
---
261+
```
262+
263+
<Note>
264+
The webhook name must exactly match the key defined in your OpenAPI specification's `webhooks` field.
265+
</Note>

0 commit comments

Comments
 (0)