Skip to main content

Overview

Many applications maintain multiple API versions simultaneously (e.g. v1, v2) or separate internal APIs from public APIs. Geni includes native multi-document support with an interactive version switcher dropdown in the documentation portal sidebar.

Configuration

Define named versions under the apis key in config/geni.php:
config/geni.php

Generated Endpoints

When named APIs are configured, Geni automatically registers dedicated routes for each version: Visiting the root /docs/api automatically redirects to the first configured API version.

Interactive Version Switcher

When > 1 APIs are defined, an interactive dropdown appears in the documentation portal sidebar:
API v2 (Latest)
Selecting a different version switches specifications in-place without a full page reload and updates the browser URL via history.pushState().

CLI Support

All CLI commands accept an --api option to target a specific named specification: