An environment is a JSON object containing key-value pairs of the data you want to reference. There are different levels of environments that can be used in requests and scripts:
- Global environments, which can be accessed by all collections in a project
- Collection environments, which can be accessed by all requests in a collection
- Folder environments, which can be accessed by all requests in a folder
Global and collection environments contain:
- A base environment, commonly used for default values that don’t vary across environments
- Optional sub-environments, commonly used for environment-specific values (production, staging, development) or user-specific configurations. Sub-environments can be marked as private. In this case, they aren’t synced or exported, and require a vault key to be accessed.
You can also define variables dynamically in the Collection Runner and in pre-request and after-response scripts. For more details, see Dynamic variables.