Reference OpenAPI endpoints in your docs pages
mint openapi-check <openapiFilenameOrUrl>
.servers
field to your OpenAPI document with your API’s base URL.
/users/{id}
or simply /
. The base URL defines where these paths should be appended. For more information on how to configure the servers
field, see API Server and Base Path in the OpenAPI documentation.
The API playground uses these server URLs to determine where to send requests. If you specify multiple servers, a dropdown will allow users to toggle between servers. If you do not specify a server, the API playground will use simple mode since it cannot send requests without a base URL.
If your API has endpoints that exist at different URLs, you can override the server field for a given path or operation.
securitySchemes
and security
fields in your OpenAPI document. The API descriptions and API Playground will add authentication fields based on the security configurations in your OpenAPI document.
Define your authentication method.
securitySchemes
field to define how users authenticate.This example shows a configuration for bearer authentication.Apply authentication to your endpoints.
security
field to require authentication.x-mint
extensionx-mint
extension is a custom OpenAPI extension that provides additional control over how your API documentation is generated and displayed.
x-mint: metadata
to any operation. You can use any metadata field that would be valid in MDX
frontmatter except for openapi
, version
, or deprecated
:
x-mint: content
:
content
extension supports all Mintlify MDX components and formatting.
x-mint: href
:
x-mint: href
is present, the navigation entry will link directly to the specified URL instead of generating an API page.
openapi
field to any navigation element in your docs.json
to automatically generate pages for OpenAPI endpoints. The openapi
field accepts either a file path in your docs repo or a URL to a hosted OpenAPI document.
Generated endpoint pages have these default metadata values:
title
: The operation’s summary
field, if present. If there is no summary
, the title is generated from the HTTP method and endpoint.description
: The operation’s description
field, if present.version
: The version
value from the parent anchor or tab, if present.deprecated
: The operation’s deprecated
field. If true
, a deprecated label will appear next to the endpoint title in the side navigation and on the endpoint page.openapi
field to any navigation element. All endpoints in the specification will be included:
directory
field is optional and specifies where generated API pages are stored in your docs repo. If not specified, defaults to the api-reference
directory of your repo.MDX
files for API pagesMDX
pages for each operation. This lets you customize page metadata, add content, omit certain operations, or reorder pages in your navigation at the page level.
See an example MDX OpenAPI page from MindsDB and how it appears in their live documentation.
MDX
page for each endpoint and specify which OpenAPI operation to display using the openapi
field in the frontmatter.
When you reference an OpenAPI operation this way, the name, description, parameters, responses, and API playground are automatically generated from your OpenAPI document.
If you have multiple OpenAPI files, include the file path in your reference to ensure Mintlify finds the correct OpenAPI document. If you have only one OpenAPI file, Mintlify will detect it automatically.
docs.json
.
MDX
filesMDX
pages for large OpenAPI documents.
MDX
page for each operation in the paths
field of your OpenAPI document.MDX
page for each operation in the webhooks
field of your OpenAPI document.docs.json
.Generate `MDX` files.
Specify an output folder.
-o
flag to specify a folder to populate the files into. If a folder is not specified, the files will populate in the working directory.MDX
files for OpenAPI schemascomponents.schema
field:
webhooks
field to your OpenAPI document alongside the paths
field.
For more information on defining webhooks, see Webhooks in the OpenAPI documentation.
webhook
instead of HTTP methods like GET
or POST
:
webhooks
field.