Mintlify transforms OpenAPI 3.0 and 3.1 specifications into modern, interactive API documentation. Instead of manually writing markdown tables for request parameters, headers, and payload schemas, development and documentation teams can import an OpenAPI file in JSON or YAML format. Mintlify automatically parses the endpoints, renders structured parameter lists, provides code sample generators across multiple programming languages, and supplies a live API playground where developers can test requests directly from the browser.
The platform follows a docs-as-code workflow. Your OpenAPI definition lives alongside your documentation source in Git, and any configuration changes are managed through Mintlify's central configuration file (docs.json, or mint.json in earlier setups). Depending on your team's workflow, you can either automatically generate an entire API reference section from the spec with zero manual maintenance, or bind individual OpenAPI endpoints to custom MDX pages to weave narrative guides around your operations.
Prerequisites and Supported Formats
Before configuring Mintlify, verify that your specification meets the following criteria:
- Specification Versions: Mintlify natively supports OpenAPI Specification (OAS) 3.0 and 3.1. If your existing specification is still in Swagger 2.0 format, convert it to OpenAPI 3.0 prior to importing.
- File Formats: Both JSON (
.json) and YAML (.yamlor.yml) formats are supported. - Reference Limitations: Mintlify resolves internal references (
$ref: '#/components/schemas/Resource') seamlessly within a single document. However, external references pointing to separate external schema files are not supported. If your team splits schemas across multiple files, bundle them into a single file (using tools such as Redocly CLI or@apidevtools/swagger-cli) before feeding them into Mintlify.
Step 1: Placing the OpenAPI Specification File
You can introduce your OpenAPI file to Mintlify through either local repository storage or a remote URL:
-
Local Repository (Recommended): Place your specification file directly inside your documentation repository. A common pattern is placing it in the root directory (for example,
openapi.jsonoropenapi.yaml) or inside a dedicated API directory (such asapi-reference/openapi.jsonorspecs/v1.yaml). -
Hosted Remote URL: If your backend CI/CD pipeline automatically publishes an updated specification file to an accessible object storage bucket or CDN, you can provide an HTTPS URL directly (for example,
https://api.example.com/specs/openapi.json). For production builds, remote specification URLs must use HTTPS.
Step 2: Configuring Navigation in docs.json
To render the API reference in your documentation sidebar, map the specification within the navigation object of docs.json.
Approach A: Automatic Reference Generation
If you want Mintlify to automatically parse all paths, group them by their OpenAPI tags, and generate endpoint pages on the fly, reference the file directly within a navigation tab or group:
{
"$schema": "https://mintlify.com/docs.json",
"name": "Acme API Docs",
"navigation": {
"tabs": [
{
"tab": "Guides",
"groups": [
{
"group": "Getting Started",
"pages": ["introduction", "quickstart"]
}
]
},
{
"tab": "API Reference",
"openapi": "openapi.json"
}
]
}
}
When Mintlify reads this configuration, it inspects every endpoint defined under paths, extracts the HTTP method, summary, description, parameters, and responses, and automatically creates a browsable navigation structure without requiring a single MDX file.
Handling Multiple Specifications
If your platform consists of distinct microservices or separate API versions, pass an array of file paths:
{
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": [
"specs/v1/auth.json",
"specs/v1/billing.json",
"specs/v2/core.json"
]
}
]
}
}
Step 3: Granular Control with MDX Endpoint Pages
While full auto-generation requires the least maintenance, technical writers often need to insert custom narrative content, callout warnings, prerequisites, architecture diagrams, or bespoke code snippets alongside an endpoint. Mintlify enables this hybrid approach through frontmatter binding.
1. Linking an MDX File to a Specific Endpoint
Create an MDX file (for example, api-reference/users/create.mdx) and specify the HTTP method and route in the openapi frontmatter key:
---
title: "Create User"
sidebarTitle: "Create User"
description: "Register a new user account within an organization"
openapi: "POST /v1/users"
---
## Overview
Before creating a user, ensure that your application has obtained the `users:write` OAuth scope.
<Warning>
User email addresses must be unique across the entire organization. Attempting to register an existing email will return a `409 Conflict`.
</Warning>
## Webhook Notifications
Upon successful registration, Acme triggers a `user.created` event to your configured webhook endpoints.
Mintlify parses POST /v1/users from your global OpenAPI specification, injects the interactive request builder and parameter documentation directly into the page, and places your custom MDX copy seamlessly around it.
If your project imports multiple OpenAPI files, prepend the specific file path to avoid route collisions:
---
title: "Create User"
openapi: "specs/v1/auth.json POST /v1/users"
---
2. Scaffolding MDX Pages Using the Mintlify Scraper
If you have dozens of endpoints and want individual MDX files generated automatically so you can selectively customize them, use Mintlify's official scraping utility:
npx @mintlify/scraping@latest openapi-file ./openapi.json -o api-reference
This command parses your specification and generates dedicated MDX files for each operation inside the api-reference directory, pre-configured with the corresponding openapi frontmatter properties.
Step 4: Configuring the Interactive API Playground
Mintlify's interactive playground allows developers to send live HTTP requests directly from the documentation. To ensure the playground functions smoothly, align your OpenAPI file and docs.json settings:
1. Defining the Base URL
Mintlify derives target URLs from the servers array in your OpenAPI document:
servers:
- url: https://api.example.com/v1
description: Production Server
- url: https://staging.api.example.com/v1
description: Staging Sandbox
If multiple servers are defined, Mintlify displays a dropdown selector in the playground interface.
2. Setting Up Authentication Schemes
Configure securitySchemes in your specification so the playground prompts users for appropriate credentials:
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Enter your account API token
security:
- bearerAuth: []
To provide safe test credentials or demo keys in documentation sandboxes, you can define the x-default vendor extension on your security scheme:
{
"components": {
"securitySchemes": {
"apiKey": {
"type": "apiKey",
"in": "header",
"name": "X-API-Key",
"x-default": "demo_pk_live_testing123"
}
}
}
}
3. Handling Browser CORS Requirements
Because the interactive playground issues real HTTP requests from the developer's web browser, your API server must support Cross-Origin Resource Sharing (CORS). Ensure your staging or public endpoints return appropriate headers:
Access-Control-Allow-Origin: *(or your documentation domain)Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONSAccess-Control-Allow-Headers: Authorization, Content-Type, X-API-Key
If your backend rejects browser preflight requests (OPTIONS), the playground will fail to receive responses even if curl commands succeed.
Step 5: Modifying Specifications with OpenAPI Overlays
Technical writers often encounter backend-generated OpenAPI specs containing internal endpoints, technical jargon, or missing marketing copy that cannot easily be modified in source code. Rather than manually editing or maintaining a divergent copy of the spec, Mintlify supports the OpenAPI Overlay Specification (v1.1.0).
An overlay file defines targeted JSONPath actions (update, remove, copy) applied during documentation compilation.
Create an overlay file (for example, overlays/public-filter.yaml):
overlay: 1.1.0
info:
title: Public Documentation Tweaks
version: 1.0.0
extends: ./openapi.json
actions:
- target: $.info.description
update: "Welcome to Acme's developer documentation. Explore endpoints and test payloads."
- target: $.paths['/internal/system-health']
remove: true
- target: $.paths['/v1/billing'].post.summary
update: "Create recurring billing subscription"
Then reference the overlay in your docs.json:
{
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": {
"source": "openapi.json",
"overlays": ["overlays/public-filter.yaml"]
}
}
]
}
}
Mintlify applies the overlay non-destructively, stripping out internal routes and updating customer-facing descriptions while keeping upstream engineering specs pristine.
Step 6: Local Validation and CI/CD Automation
Before deploying documentation updates to production, validate the configuration locally using the Mintlify CLI.
-
Install and Run the Dev Server:
npm i -g mintlify mint dev -
Testing Local Schema Endpoints: If your backend service runs locally (for instance,
http://localhost:8000/openapi.json), start the Mintlify server with the local schema permission flag:mint dev --local-schema -
Strict Validation Checks: Run syntax and integrity checks to catch broken schema references or formatting discrepancies:
mint validate -
Continuous Integration (CI): Incorporate
mint validateinto your GitHub Actions or GitLab CI pipelines. Whenever backend engineers push changes to the OpenAPI file, CI verifies that all references resolve, preventing broken documentation from reaching production.