Variables and environments
{{name}} works in URLs, params, headers, bodies and auth fields.
Where variables are set
Section titled “Where variables are set”| 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 |
name: stagingvariables: - name: baseUrl value: https://staging.example.com - name: apiKey secret: true # value is kept in .cactus/, not in this filePick the active environment in the sidebar. In the CLI, use -e <name>.
Precedence
Section titled “Precedence”Lowest to highest:
- Collection
- Environment
- Folders, outermost first
- Request
- Secrets
- Captured
When sending as a critter, the project’s captured values are left out and these are added on top:
- Critter variables
- Critter secrets
- Critter context (its captured values)
- Values set by earlier tool steps in the flow run
- 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}}.