Multiple Server URLs

Switch between different API environments seamlessly

You can configure multiple server URLs in your API Reference to allow users to switch between different environments (e.g., production and sandbox). This is particularly useful when users need to test their integration before going live.

Configuration

You can configure multiple server URLs in your API definition using either Fern Definition or OpenAPI:

User Interface

When multiple servers are configured, users will see a dropdown menu in the API Reference that allows them to switch between environments:

Here’s an example of the Flagright docs site with multiple server names configured.

1openapi: 3.0.0
2servers:
3 - url: https://sandbox.api.flagright.com
4 x-fern-server-name: Sandbox API server (eu-1)
5 - url: https://sandbox-asia-1.api.flagright.com
6 x-fern-server-name: Sandbox API server (asia-1)

Environment Persistence

When you select an environment, it’s reflected across the entire API Reference - both in the displayed URLs and in the API Explorer. This selection persists as you navigate between different pages.

You can also double-click the server URL to manually edit it, allowing for quick testing against custom environments or endpoints.