For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Slack communityLog inBook a demo
  • Getting Started
    • Overview
    • Quickstart
    • Customer Showcase
  • Writing Content
    • Markdown
    • Visual Editor
    • Reusable Markdown
    • Custom React Components
      • Generate API Reference
      • SDK Snippets
      • HTTP Snippets
      • Endpoint Errors
      • Audiences
      • Customize API Reference Layout
      • Write Markdown in API Reference
      • Generate Webhook Reference
      • Multiple Server URLs
      • Generate WebSocket Reference
      • Generate OpenRPC Reference
    • Changelog
LogoLogo
Slack communityLog inBook a demo
On this page
  • Configuration
  • User Interface
  • Environment Persistence
API References

Multiple Server URLs

Switch between different API environments seamlessly
Was this page helpful?
Previous

Generate WebSocket Reference

Next
Built with

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:

  • Configure servers in OpenAPI
  • Configure environments in Fern Definition

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.

OpenAPI
Fern Definition
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.