Add an OpenAPI specification file
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI document in either JSON or YAML format that follows the OpenAPI specification. Your document must follow OpenAPI specification 3.0+.To validate your OpenAPI spec, use our CLI and run this command:
mintlify openapi-check <openapiFilenameOrUrl>
Auto-populate API pages
The fastest way to get started with OpenAPI is to add anopenapi
field to a tab in the docs.json
. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab.
Example with Tabs:

The directory field is optional. If not specified, the files will be placed in the api-reference folder of the docs repo.
-
title
: Thesummary
field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint. -
description
: Thedescription
field from the OpenAPI operation, if present. -
version
: Theversion
value from the anchor or tab, if present.
If you have some endpoints in your OpenAPI schema that you don’t want pages generated for automatically, you can add the x-hidden property
Create MDX files for API pages
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you’ll need an MDX page for each operation. Here is an example MDX OpenAPI page from MindsDB.
Manually specify files
You can always create an MDX page manually, and reference the OpenAPI operation in the page’s metadata using theopenapi
field.
By using the OpenAPI reference, the name, description, parameters, responses,
and the API playground will be automatically generated from the OpenAPI document.
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
only one OpenAPI file - it will automatically detect your OpenAPI file.
If you want to reference an external OpenAPI file using this method, provide the file’s URL in the docs.json. See here for the correct format.
In most cases, the method and path must match the method and path specified
in the OpenAPI document exactly. If the endpoint doesn’t exist in the OpenAPI
file, the page will be empty.For webhooks, replace the method (i.e. “POST”) with “webhook” (case insensitive)
and the correct method will be generated.
Autogenerate files
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper. Our Mintlify scraper autogenerates MDX files for your OpenAPI endpoints. Each generated page will correspond to an OpenAPI operation under the “paths” section of the OpenAPI schema. If your OpenAPI document is version 3.1+, the scraper will also generate pages for webhooks under the “webhooks” section of the OpenAPI schema.-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.
If your OpenAPI document is invalid, the files will not autogenerate.
Create MDX files for OpenAPI schemas
Mintlify also allows you to create individual pages for any OpenAPI schema defined in an OpenAPI document’scomponents.schemas
field: