Servers

What are Servers?

Servers define the base URLs for your API. A project can have multiple servers to represent different deployment environments or API versions.

Multiple Base URLs

Servers are different from environments. Environments hold variables, while servers define where your API is hosted.

Example Server Configuration

A typical project might have these servers:

https://api.example.com(Production)
https://staging.api.example.com(Staging)
http://localhost:3000(Local)

Managing Servers

1

Open Project Menu

Click the three-dot menu (⋮) next to the project name.

2

Select "Servers"

Click the "Servers" option in the dropdown.

3

Servers Modal Opens

A modal appears where you can add, edit, or remove server URLs.

Servers Modal

Servers - Order API
+

• Type a URL and press Enter or click + to add

• Click ✕ next to a URL to remove it

• Click Save to apply changes

Servers vs Environments

Understanding the difference:

Servers
  • Define base URLs
  • Where your API is hosted
  • Static values
  • Used for documentation/OpenAPI
Environments
  • Define variables
  • Key-value pairs
  • Dynamic substitution
  • Used in requests

Best Practice

Define your servers for documentation purposes, but use environment variables like {{baseUrl}} in your actual requests. This gives you the flexibility of environments with the documentation benefit of servers.

When to Use Servers

API Documentation

When exporting your project as OpenAPI, servers are included in the spec. This tells API consumers where they can access your API.

Multiple API Versions

If your API has multiple versions with different base URLs (e.g., /v1, /v2), you can define them as separate servers.

Regional Endpoints

APIs with regional deployments (US, EU, APAC) can list all regions as different servers.