AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Mintlify Multi-Version Docs and Release Branches for Versioned APIs

蕭舒芸 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Maintaining parallel API documentation across multiple major versions (such as v1 and v2) or active Long-Term Support (LTS) releases poses a major operational dilemma: mixing disparate endpoint specifications confuses developers, while isolated documentation sites fragment search and multiply maintenance overhead. In Mintlify, technical teams solve this through two primary architectural patterns: the native Directory-Based Monorepo (using navigation.versions in docs.json) and the Branch-Mapped Multi-Deployment (binding distinct Git release branches to subdomains via navigation.global.versions).

At 365Finds, our commercial recommendation is definitive: adopt the directory-based monorepo architecture within a single deployment branch (main) for more than 90% of API documentation systems. It guarantees unified client-side version switching, preserves indexed full-text and semantic search without cross-domain auth drops, and eliminates configuration drift. Reserve multi-branch deployments strictly for enterprise environments where legal, compliance, or air-gapped constraints mandate strict Git branch immutability.


Architecture Comparison: Monorepo vs. Git Release Branches

Before writing configuration, documentation architects must select the model that fits their release lifecycle:

DimensionDirectory-Based Monorepo (navigation.versions)Branch-Mapped Multi-Deployment (release/* branches)
Git StructureSingle main branch; isolated /v1 and /v2 foldersDedicated Git branches (main, release/v1, release/v2)
Site DeploymentSingle Mintlify project; unified domain (e.g., docs.example.com)Multiple Mintlify projects or subdomains (v1.docs.example.com)
Version SwitcherBuilt-in UI dropdown in header; seamless client-side toggleGlobal navigation switcher via external href links
Search ExperienceUnified index; scoped search filtering within active versionSeparate search indexes per subdomain; no native unified search
Spec DisambiguationExplicit relative paths (v1/openapi.json, v2/openapi.json)Independent root openapi.json per branch
Maintenance CostLow; single PR updates navigation, banners, and versionsHigh; requires backporting fixes across long-lived Git branches
Recommended ForSaaS, fast-moving APIs, public developer platformsRegulated enterprise APIs, strict LTS air-gapped releases

Step 1: Establish Directory Hierarchy and OpenAPI Spec Isolation

When operating the recommended directory-based pattern, structure the repository so that every version possesses an autonomous namespace for OpenAPI specifications and MDX guides:

my-mintlify-docs/
├── docs.json                 # Global configuration (migrated from mint.json)
├── assets/
│   └── logo.svg
├── v1/
│   ├── openapi.json          # v1 OpenAPI 3.0/3.1 specification
│   ├── overview.mdx          # v1 Landing page
│   ├── quickstart.mdx
│   └── endpoints/
│       ├── get-users.mdx
│       └── create-user.mdx
└── v2/
    ├── openapi.json          # v2 OpenAPI 3.0/3.1 specification
    ├── overview.mdx          # v2 Landing page
    ├── migration-guide.mdx   # Crucial v1-to-v2 upgrade path
    └── endpoints/
        ├── get-users.mdx
        └── create-user.mdx

[!NOTE] Mintlify officially deprecated mint.json in favor of docs.json. While legacy mint.json files still load on older CLI versions, all modern multi-version navigation features, search multipliers, and schema validations require docs.json (schema: https://mintlify.com/docs.json).


Step 2: Configure navigation.versions in docs.json

The core of multi-version technical documentation lies in the navigation.versions array. Each entry defines the version display tag, designates default status, and nests an isolated navigation tree with independent groups and pages:

{
  "$schema": "https://mintlify.com/docs.json",
  "theme": "mint",
  "name": "CloudScale API Reference",
  "colors": {
    "primary": "#0D9373",
    "light": "#55D799",
    "dark": "#0D9373"
  },
  "navigation": {
    "versions": [
      {
        "version": "v2 (Latest)",
        "default": true,
        "groups": [
          {
            "group": "Getting Started",
            "pages": [
              "v2/overview",
              "v2/quickstart",
              "v2/migration-guide"
            ]
          },
          {
            "group": "Core Endpoints",
            "openapi": "v2/openapi.json",
            "pages": [
              "v2/endpoints/get-users",
              "v2/endpoints/create-user"
            ]
          }
        ]
      },
      {
        "version": "v1 (LTS)",
        "groups": [
          {
            "group": "Getting Started",
            "pages": [
              "v1/overview",
              "v1/quickstart"
            ]
          },
          {
            "group": "Core Endpoints",
            "boost": 0.2,
            "openapi": "v1/openapi.json",
            "pages": [
              "v1/endpoints/get-users",
              "v1/endpoints/create-user"
            ]
          }
        ]
      }
    ]
  }
}

Essential Navigation Rules:

  1. default: true: Assign this attribute to exactly one version (your current production release). Visitors reaching the root documentation URL (/) automatically resolve to the first page of this version.
  2. Search Ranking Governance (boost): Notice the "boost": 0.2 on the v1 Core Endpoints group. In Mintlify, child pages inherit search multipliers from parent groups. Dampening legacy groups (values between 0.1 and 0.5) prevents deprecated endpoints from ranking above modern v2 endpoints in search results.
  3. Dropdown Generation: Mintlify automatically converts this structure into a top-level version switcher dropdown in the header navbar without requiring custom React components.

Step 3: Eliminate OpenAPI Resolution Ambiguity

A critical failure mode in versioned technical documentation occurs when both v1/openapi.json and v2/openapi.json define identical operation routes, such as GET /users/{id}.

If an MDX page frontmatter specifies only openapi: "GET /users/{id}", Mintlify parses all specifications in the project and defaults alphabetically or unpredictably. This leads to v1 pages rendering v2 response schemas, or v2 pages exhibiting legacy v1 parameters.

Explicit Specification Disambiguation

Always prefix the endpoint with the relative spec path inside your MDX frontmatter:

---
title: "Get User Profile"
openapi: "v1/openapi.json GET /users/{id}"
deprecated: true
---

This endpoint retrieves account details under the legacy v1 contract. 

<Warning>
  v1 endpoints will reach End-of-Life on December 31, 2026. For high-throughput requirements, migrate to [v2 Get User Profile](/v2/endpoints/get-users).
</Warning>

Correspondingly, in the modern v2 page:

---
title: "Get User Profile"
openapi: "v2/openapi.json GET /users/{id}"
---

Retrieve user entity records with fine-grained role scopes and tenant identification.

Parameter-Level Deprecation

If individual fields within an active specification are being phased out before a full major version cut, tag them explicitly in Mintlify MDX components or within the OpenAPI schema:

<ParamField path="legacy_tenant_token" type="string" deprecated>
  Replaced by `Authorization: Bearer <token>` header in v2.0.
</ParamField>

Step 4: Configure Deprecation Banners and Version Governance

When supporting legacy or LTS versions, developer navigation errors account for substantial support ticket overhead. Governance requires active warning signals.

1. Global Announcement / Deprecation Banner (docs.json)

At the root level of docs.json, declare a persistent warning banner that alerts visitors:

{
  "banner": {
    "content": "⚠️ You are viewing v1 (LTS) documentation. v1 enters maintenance mode on Dec 31, 2026. Read the [v2 Migration Guide](/v2/migration-guide).",
    "type": "warning",
    "dismissible": false
  }
}

2. Page-Level Visual Deprecation

Adding deprecated: true to page YAML frontmatter automatically attaches a red/amber "Deprecated" badge directly beside the H1 title in Mintlify's rendering engine, signaling status before the reader inspects code blocks.


Step 5: Implement Git Release Branches for Air-Gapped or Subdomain Deployments

For organizations whose governance strictly forbids committing legacy archived files into main, configure the Branch-Mapped Multi-Deployment model:

flowchart TD
    subgraph GitHub Repository
        MainBranch["Branch: main (v2 / Latest)"]
        LTSBranch["Branch: release/v1.0 (v1 / LTS)"]
    end

    subgraph Mintlify Dashboard Deployments
        ProjectA["Primary Project - Domain: docs.example.com"]
        ProjectB["Archived Project - Domain: v1.docs.example.com"]
    end

    MainBranch -->|Auto-deploy on push| ProjectA
    LTSBranch -->|Auto-deploy on push| ProjectB

Git Branch Mapping Workflow:

  1. Branch Cut: When cutting v2, branch off the existing documentation to release/v1.0:
    git checkout -b release/v1.0
    git push origin release/v1.0
    
  2. Dashboard Binding: In the Mintlify dashboard, create a secondary project connected to the same repository, but set its Deployment Branch to release/v1.0. Assign it a custom subdomain (e.g., v1.docs.example.com).
  3. Global Navbar Switcher (navigation.global.versions): In both projects' docs.json, use navigation.global.versions with explicit href targets:
{
  "navigation": {
    "global": {
      "versions": [
        {
          "version": "v2 (Latest)",
          "href": "https://docs.example.com/overview",
          "default": true
        },
        {
          "version": "v1 (LTS)",
          "href": "https://v1.docs.example.com/overview"
        }
      ]
    }
  }
}

Step 6: Automated CI/CD Validation Pipeline

To prevent broken endpoint references, circular redirects, or schema drift during version branch management, enforce automated validation in GitHub Actions on every pull request:

name: Validate Versioned Documentation

on:
  pull_request:
    branches: [main, release/*]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install Mintlify CLI
        run: npm install -g @mintlify/cli@latest

      - name: Validate Configuration and Specs
        run: mint validate

Mintlify's CLI detects missing OpenAPI references, invalid frontmatter strings, broken intra-version links, and deprecated mint.json syntax before PR merges. Furthermore, Mintlify automatically provides preview deployments formatted as <subdomain>-<branch>.mintlify.site for every PR, allowing DevRel engineers to verify the version switcher dropdown prior to production release.


365Finds Institutional Take

When architecting versioned API documentation in Mintlify:


References