Skip to main content

Environments

What Are Environments?

An Environment is a set of key-value variables used in API requests to dynamically control values like base URLs, tokens, and headers. This allows you to reuse and manage configurations across multiple contexts like dev, staging, and production.

Key Features

  • Global and workspace-scoped variables
  • Environment selection per request run
  • Variable interpolation in URLs, headers, and bodies
  • Support for secrets and auth tokens

Benefits

  • Reduces hardcoded values in API requests
  • Makes switching between stages seamless
  • Promotes cleaner, maintainable collections

How Sparrow Implements It

  • Create multiple environments in a workspace
  • Use {{variable}} syntax in requests
  • Choose the environment from the top-right dropdown before executing requests

Ideal Use Cases

  • Switching base URLs across environments
  • Managing tokens across multiple APIs
  • Injecting dynamic parameters during testing