Skip to content

Variables and environments

{{name}} works in URLs, params, headers, bodies and auth fields.

Where File
Collection opencollection.yml → request.variables
Environment environments/<name>.yml → variables
Folder <folder>/folder.yml → request.variables
Request runtime.variables
Secrets .cactus/secrets.json, set under Variables (Ctrl+E)
Captured .cactus/captured.json, written by captures
environments/staging.yml
name: staging
variables:
- name: baseUrl
value: https://staging.example.com
- name: apiKey
secret: true # value is kept in .cactus/, not in this file

Pick the active environment in the sidebar. In the CLI, use -e <name>.

Lowest to highest:

  1. Collection
  2. Environment
  3. Folders, outermost first
  4. Request
  5. Secrets
  6. Captured

When sending as a critter, the project’s captured values are left out and these are added on top:

  1. Critter variables
  2. Critter secrets
  3. Critter context (its captured values)
  4. Values set by earlier tool steps in the flow run
  5. The flow step’s with

The Variables dialog shows each variable’s value and which layer it came from.

  • Values are filled in once. A value that contains {{b}} stays as the text {{b}}.
  • Unknown names are sent as written and listed as unresolved.
  • {{ name }} is the same as {{name}}.