Generate docs pages for your API endpoints using MDX
MDX
files rather than using an OpenAPI specification. This method provides flexibility for custom content, but we recommend generating API documentation from an OpenAPI specification file for most projects because it is more maintainable and feature-rich. However, creating MDX
pages for an API can be useful to document small APIs, prototyping, or when you want more control over where API endpoints are in the navigation.
To generate pages for API endpoints using MDX
, configure your API settings in docs.json
, create individual MDX
files for each endpoint, and use components like <ParamFields />
to define parameters. From these definitions, Mintlify generates interactive API playgrounds, request examples, and response examples.
Configure your API
docs.json
file, define your base URL and auth method:display
field. You do not need to include an auth method if you hide the playground.Create your endpoint pages
MDX
file. At the top of each file, define title
and api
:{}
:server
field configured in docs.json
, you can use relative paths like /v1/endpoint
.playground
to the frontmatter:playground: 'interactive'
- Display the interactive playground.playground: 'simple'
- Display a copyable endpoint with no playground.playground: 'none'
- Hide the playground.Add your endpoints to your docs
navigation
field in your docs.json
. Learn more about structuring your docs in Navigation.docs.json
to enable it globally on every page or you can set it on a per-page basis.
A page’s authentication method will override a global method if both are set.
none
authentication method is useful to disable authentication on a specific endpoint after setting a default in docs.json.