AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Multi-Version Documentation and Route Branching in Mintlify Without Broken Links

矢嶋雄基 · 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

Releasing a major, breaking API version—such as transitioning from v1 to v2—is one of the most critical inflection points for an engineering organization. For documentation architects, developer relations (DevRel) teams, and API platform leads, this transition introduces a treacherous engineering challenge: how to publish and maintain documentation for multiple runtime versions simultaneously without introducing 404 errors, confusing navigation dropdowns, or degrading SEO search authority.

At 365Finds, our research into developer experience across hundreds of modern developer portals indicates that broken documentation links directly degrade API adoption. Developers do not upgrade client libraries instantaneously. External tutorials, SDK documentation comments, StackOverflow answers, and customer bookmarks point to historical URLs. If your migration strategy consists of modifying pages in-place or reshuffling slugs without a persistent routing pipeline, you rupture that inbound traffic.

Mintlify provides a robust, declarative architecture for multi-version documentation through its central configuration file, docs.json. However, achieving zero-downtime, link-persistent multi-version documentation requires disciplined repository structure, precise navigation group binding, and proactive route redirection. This guide breaks down the concrete steps to architect multi-version documentation in Mintlify without breaking existing links.


1. Architectural Strategy: Folder Isolation vs. Git Branching

Before writing a single line of configuration in docs.json, teams must choose between two branching strategies: Git branch isolation and directory-level file isolation.

365Finds strongly advises directory-level file isolation within a single primary branch (monorepo structure) for Mintlify sites, rather than maintaining long-lived Git branches for older documentation versions.

Maintaining separate Git branches for older versions creates chronic synchronization debt. Global layout updates, theme tweaks, search indexing, and shared operational guides (such as security policies, webhook signatures, or authentication principles) must be manually backported across branches, leading to drift.

By adopting a folder-segregated structure on your default deployment branch, both current and legacy versions remain immediately auditable, searchable, and maintainable side-by-side:

my-docs-repo/
├── docs.json
├── openapi/
│   ├── v1.json
│   └── v2.json
├── v1/
│   ├── quickstart.mdx
│   ├── authentication.mdx
│   └── api-reference/
│       ├── users.mdx
│       └── webhooks.mdx
├── v2/
│   ├── quickstart.mdx
│   ├── authentication.mdx
│   └── api-reference/
│       ├── users.mdx
│       └── webhooks.mdx
└── common/
    ├── company-overview.mdx
    └── status.mdx

Key Principles of this Directory Layout:

  1. Explicit Version Prefixes in File Paths: Every version-specific page resides under its respective root path (v1/ or v2/).
  2. Dedicated OpenAPI Artifacts: Separate API schemas (openapi/v1.json vs. openapi/v2.json) ensure that autogenerated endpoint documentation remains strictly decoupled.
  3. Common Guides Partitioning: Truly version-agnostic documentation can reside in an unversioned folder or be selectively bound across navigation trees.

2. Configuring Versions in docs.json

Mintlify manages versioning through declarative properties in docs.json. The framework automatically renders an interactive version switcher dropdown in the header and sidebar once these arrays are declared.

Defining the Versions Array

You can configure the active versions either through a root-level versions declaration or inside the navigation object. To provide maximum clarity to Mintlify's routing engine and UI switcher, define the version tags and designate your active production version as default:

{
  "$schema": "https://mintlify.com/docs.json",
  "name": "Acme API Docs",
  "theme": "mint",
  "colors": {
    "primary": "#0D9371"
  },
  "versions": [
    "v2",
    "v1"
  ]
}

By default, Mintlify treats the first version listed in the versions array as the default active version loaded by visitors visiting root URLs. When you launch v2, placing "v2" at index 0 immediately sets it as the default surface for incoming web traffic.

To enrich the switcher dropdown with visual status labels—such as marking v2 as "Latest" and v1 as "Legacy"—use the navigation.global.versions object array:

{
  "navigation": {
    "global": {
      "versions": [
        {
          "version": "v2",
          "default": true,
          "tag": "Latest"
        },
        {
          "version": "v1",
          "tag": "Deprecated"
        }
      ]
    }
  }
}

3. Binding Navigation Groups to Target Versions

A common pitfall encountered by teams deploying multi-version documentation is "navigation leakage"—where v1 endpoints bleed into the v2 sidebar, or switching the dropdown fails to update sidebar groups.

In Mintlify's navigation schema, groups are bound to versions by setting the version attribute directly on the group object. When a user switches versions in the UI dropdown, Mintlify filters the sidebar to display exclusively the groups bound to the selected version slug.

{
  "navigation": {
    "groups": [
      {
        "group": "Overview",
        "version": "v2",
        "pages": [
          "v2/quickstart",
          "v2/authentication"
        ]
      },
      {
        "group": "Endpoints",
        "version": "v2",
        "pages": [
          "v2/api-reference/users",
          "v2/api-reference/webhooks"
        ]
      },
      {
        "group": "Overview",
        "version": "v1",
        "pages": [
          "v1/quickstart",
          "v1/authentication"
        ]
      },
      {
        "group": "Endpoints",
        "version": "v1",
        "pages": [
          "v1/api-reference/users",
          "v1/api-reference/webhooks"
        ]
      }
    ]
  }
}

Version Binding Rules:


4. The Link-Preservation Pipeline: Configuring Persistent Redirects

The most catastrophic hazard during a multi-version restructuring is breaking historical links.

Consider this real-world scenario: For the past two years, your documentation site ran without version prefixes. Endpoints were accessed at /api-reference/users. When launching v2, your team moves existing v1 files into a /v1/ directory and creates new /v2/ files. Immediately, every existing bookmark, third-party blog link, and GitHub code reference pointing to /api-reference/users returns a 404 error.

Mintlify resolves this through its root-level redirects array in docs.json.

{
  "redirects": [
    {
      "source": "/api-reference/:slug*",
      "destination": "/v1/api-reference/:slug*",
      "permanent": true
    },
    {
      "source": "/quickstart",
      "destination": "/v2/quickstart",
      "permanent": true
    }
  ]
}

Redirect Behavior and Constraints in Mintlify

Setting / FeatureRule & Mintlify SpecificationArchitectural Impact
HTTP Status CodeDefaults to 308 (Permanent). Set "permanent": false for 307 (Temporary).Preserves SEO indexing; search crawlers transfer link equity directly to the target slug.
Wildcard SyntaxParameterized wildcard :slug* matches dynamic path segments.Allows mass-rerouting entire folders in a single declarative rule without manual page-by-page mapping.
Wildcard LimitsOnly one wildcard * allowed per source pattern.Keep redirect patterns linear and folder-oriented; do not attempt complex regex expressions.
Query Parameters & Anchorssource cannot contain query parameters or URL anchors (#section).Route incoming requests at the slug level; destinations can contain anchors (e.g., /v2/users#authentication).

365Finds Recommended Migration Strategy

  1. Map Legacy Unversioned Paths to v1: Any link established prior to your multi-version rollout should permanently redirect (308) to its exact counterpart under /v1/. Do not redirect legacy unversioned endpoint links to v2, because developers following existing sample code expect v1 schemas and payloads.
  2. Point General Landing Pages to v2: High-level conceptual pages (such as /quickstart or /introduction) should redirect to v2 so new prospective integrators land on the modern platform.

5. Lifecycle Management: Deprecation Banners & MDX Callouts

Technical documentation must communicate API lifecycle state clearly so developers are never surprised by deprecation deadlines. In Mintlify, multi-version deprecation UX is implemented at two distinct layers: site-wide announcement banners and page-level MDX callouts.

Site-Wide Announcement Banner

Add a global notification banner in docs.json to inform visitors of upcoming lifecycle milestones:

{
  "banner": {
    "content": "⚠️ **v1 Sunset Notice**: API v1 will reach end-of-life on December 31, 2026. Explore the [v2 Migration Guide](/v2/quickstart) to upgrade.",
    "type": "warning",
    "dismissible": true
  }
}

Page-Level Deprecation Callouts

In individual v1 MDX files, place a contextual <Warning> component at the top of every endpoint page that points directly to the newer v2 alternative:

---
title: "Create User (v1)"
description: "Create a user record via the legacy v1 API"
---

<Warning>
**This endpoint is deprecated.** The v1 User API will be retired on December 31, 2026. For new implementations and enhanced webhook support, use the [v2 Create User API](/v2/api-reference/users).
</Warning>

## Request Body
...

This dual-layer messaging ensures developers landing directly on an older endpoint from Google or an IDE link are immediately informed of the upgrade path without disrupting their immediate workflow.


6. Continuous Link Integrity: CLI Validation and CI Pipeline

Never deploy multi-version documentation changes without verifying link integrity. Mintlify provides native tooling to audit internal links and redirects locally and within automated CI/CD pipelines.

Local Development and Link Checking

During local refactoring, run the Mintlify development server and run the link audit command:

# 1. Preview changes locally with live reload
mint dev

# 2. Audit all internal paths and cross-version links
mint broken-links

# 3. Validate overall schema compliance
mint validate

mint broken-links crawls your MDX files and docs.json navigation structure, verifying that every link in v1/ and v2/ resolves to an existing file and that all redirect targets exist.

Automating Pull Request Checks in CI

To prevent a developer or technical writer from accidentally merging a broken link during version branching, integrate the Mintlify CLI check into your GitHub Actions workflow:

name: Documentation Link Validation

on:
  pull_request:
    paths:
      - '**.mdx'
      - 'docs.json'

jobs:
  validate-links:
    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 mint

      - name: Run Schema Validation
        run: mint validate

      - name: Run Broken Link Audit
        run: mint broken-links

(Note: On Mintlify Pro and Enterprise tiers, native GitHub PR checks can also be configured directly via the Mintlify Dashboard under the Site settings to block merges automatically on detected broken links.)


7. Production-Ready docs.json Blueprint

Here is a complete, production-tested docs.json configuration demonstrating the full multi-version routing architecture:

{
  "$schema": "https://mintlify.com/docs.json",
  "name": "Acme Developer Platform",
  "theme": "mint",
  "colors": {
    "primary": "#0D9371",
    "light": "#10B981",
    "dark": "#047857"
  },
  "versions": [
    "v2",
    "v1"
  ],
  "banner": {
    "content": "🚀 API v2 is now generally available. Please consult the [v2 Migration Guide](/v2/quickstart).",
    "type": "info",
    "dismissible": true
  },
  "navigation": {
    "global": {
      "versions": [
        {
          "version": "v2",
          "default": true,
          "tag": "Latest"
        },
        {
          "version": "v1",
          "tag": "Legacy"
        }
      ]
    },
    "groups": [
      {
        "group": "Get Started",
        "version": "v2",
        "pages": [
          "v2/quickstart",
          "v2/authentication"
        ]
      },
      {
        "group": "Core Resources",
        "version": "v2",
        "pages": [
          "v2/api-reference/users",
          "v2/api-reference/webhooks"
        ]
      },
      {
        "group": "Get Started",
        "version": "v1",
        "pages": [
          "v1/quickstart",
          "v1/authentication"
        ]
      },
      {
        "group": "Core Resources",
        "version": "v1",
        "pages": [
          "v1/api-reference/users",
          "v1/api-reference/webhooks"
        ]
      }
    ]
  },
  "redirects": [
    {
      "source": "/api-reference/:slug*",
      "destination": "/v1/api-reference/:slug*",
      "permanent": true
    },
    {
      "source": "/getting-started/:slug*",
      "destination": "/v2/quickstart",
      "permanent": true
    }
  ]
}

8. 365Finds Engineering Verdict & Checklist

Building a durable multi-version documentation platform in Mintlify requires shifting your mindset from cosmetic documentation publishing to rigorous API routing governance.

When executing a version split, follow this checklist:

  1. Isolate Codebase Folders: Keep v1 and v2 content segregated in /v1/ and /v2/ directories on a single branch. Never rely on long-lived Git documentation branches.
  2. Declare Default Explicitly: Place your modern production version first in the versions array and set default: true in navigation.global.versions.
  3. Bind Every Group: Ensure every versioned group in navigation.groups explicitly specifies version: "v1" or version: "v2".
  4. Deploy Wildcard Redirects: Implement 308 permanent redirects mapping legacy, unversioned URLs directly to /v1/ endpoints.
  5. Inform Developers Contextually: Pair site-wide banners with page-level <Warning> components indicating sunset timelines and migration destinations.
  6. Enforce CI Quality Gates: Require mint broken-links in automated pull request checks before any multi-version change goes live.

Adhering to these steps guarantees that your developer portal delivers a modern, frictionless experience for cutting-edge integrators while preserving absolute link reliability for your existing developer base.


References