Mintlify supports the following REST API methods:

MethodDescription
GETRetrieve information about the REST API resource
POSTCreate a REST API resource
PUTUpdate a REST API resource
PATCHUpdate a REST API resource
DELETEDelete a REST API resource or related component

From the defined endpoints, we generate an API playground, request examples, and response examples.

Step 1: Configure your API

In your mint.json file, define your base URL and auth method:

{
  "api": {
    "baseUrl": "https://mintlify.com/api", //String array for multiple base URLs
    "auth": {
      "method": "bearer" // Options: bearer, basic, key.
      // Do not set method if OpenAPI spec includes security field
    }
  }
}

If you would not like to show an API playground, you don’t need to include auth types. Hide the playground with the following field:

{
  "api": {
    "playground": {
      "mode": "hide"
    }
  }
}

Find a full list of API configurations here.

Step 2: Create your endpoint pages

Each API endpoint page should have a corresponding MDX file. At the top of each file, define:

---
title: 'Create new user'
api: 'POST https://api.mintlify.com/user'
---

If the endpoint has a path parameter, the path should be determined with {} rather than : - for example:

https://api.example.com/v1/endpoint/{userId}

If you’re using an OpenAPI spec, you can autogenerate thes files using our scraper. The definition should look like:

---
title: "Create new user" // Optional - defaults to OpenAPI endpoint title
openapi: "POST https://api.mintlify.com/user"
---

Learn more at the OpenAPI guide.

If you have baseUrl configured in mint.json, you can use relative paths like /v1/endpoint.

Step 3: Add your endpoints to your docs

Add your endpoint pages to the sidebar by adding the paths to the navigation field in your mint.json. Learn more about structuring your docs here.

Pro Tip: If you’re using OpenAPI, use the scraper output to easily add the paths to your mint.json file.