Variables and Environments

Variables and Environments

Reuse values across requests and switch between environments.

Overview

A variable is a named value you write into a request as {{name}}. Relay replaces each token when it sends the request, so a base URL, an API key or an ID can be defined once and used everywhere.

Variables can be defined at several levels: globally, on a workspace, on a collection, on a folder, or in an environment. An environment is a named set of variables, such as Development or Production, and switching environments changes every request that uses its variables.

Relay also generates dynamic variables, such as {{$guid}} and {{$randomEmail}}, that produce a new value each time a request is sent.

Topics

Variables

  • Using variables: Insert values into requests with {{name}} tokens and see where each value comes from.
  • Managing environments: Switch between sets of variables for development, staging and production.

Secrets and generated values

See Also