Skip to main content
Mock API Builder
Learning Center/Environments
AvailableAdvanced

Managing Environments

Learn how to manage different environments for your mock APIs, allowing you to test across development, staging, and production.

Available in Project Settings

Open Project Settings → Environments to create named environments (development, staging, production) and configure per-endpoint overrides for each one.

Select which environment applies to a request by adding ?env=<slug> to the request URL, or by sending an X-Mock-Env header (shared links).

Core Concept

What are Environments?

Environments allow you to define sets of variables and configurations that can be applied to your mock endpoints. Instead of changing individual endpoints, you switch the active environment.

Why use them?

They make your mock APIs more flexible and realistic. You can simulate production constraints, test different data sets, or point your frontend to different backend services instantly.

How Overrides Work

Per-Endpoint Overrides

In the endpoint editor, define a different mock response, status code, or delay for each environment. The mock executor applies the override that matches the active environment automatically.

Selecting an Environment

Add ?env=<slug> to the request URL, or send an X-Mock-Envheader when calling a shared endpoint. Requests with no environment specified use the endpoint's default response.

Coming Soon

Not yet available

Variable Injection into Response Templates

You can already store key-value variables per environment in Project Settings → Environments. What isn't built yet: automatically substituting those variables into response bodies. Today, use per-endpoint overrides above to vary a response by environment.

Planned Syntax for Variable Injection

Once variable injection ships, environment variables will be accessible in response templates using double curly braces:

// Example Response Template
{
  "apiKey": "{{env.API_KEY}}",
  "service": "{{env.SERVICE_NAME}}"
}

This syntax isn't implemented yet. Use per-endpoint overrides today for environment-specific response differences.

Common Environment Types

Development
  • Minimum latency
  • Detailed error messages
  • Sandbox data sets
Staging
  • Simulated latency
  • QA-specific data
  • Limited access keys
Production
  • Realistic production delays
  • Production-ready data schemas
  • Strict validation
Set Up Your First Environment

Open Project Settings on any project to create your first environment and configure per-endpoint overrides.

Previous: AI Rule BuilderNext: Workspaces & Collaboration
Mock API Builder

Built for developers, by developers

DocumentationContactPrivacy PolicyTerms of Service

© 2026 Mock API Builder. All rights reserved.

Double-click for what's new
Learning Center
Learning Center