Organize environments with groups when you have many services
One API has three environments: Local, Staging, Production. A team with five services has fifteen, and a flat dropdown of "Payments Staging", "Billing Local", "Payments Prod (new)" is where the wrong request goes to production.
Requestarium keeps environments in groups.
The model
| Object | Example |
|---|---|
| Environment group | Payments |
| Environments in it | Local, Staging, Production |
| Variable keys | host, token, merchantId |
| Values | one per environment |
| Group | Environment | host | token |
|---|---|---|---|
| Payments | Local | http://127.0.0.1:8080 | local token |
| Payments | Staging | https://payments.stg.example.com | staging token |
| Payments | Production | https://payments.example.com | production token |
Requests use short names, {{host}}/v1/charges, and the selected environment decides where they go.
Create a group
Open the environment selector in the Collections header, create an environment, and type a new group name for it. To set up a group properly, open the group editor:
- rename the group;
- add the expected variable keys at once, one per line or separated by commas.
Every environment in the group then shows those keys. A key without a value in Staging stands out before anyone sends a request with it.
Pick the right one
The selector shows environments under their group. The selection is remembered locally for the organization and workspace you're in, so switching between workspaces doesn't carry the wrong environment along.
No environment is there for requests that only use collection variables, dynamic variables or values from scripts.
Same key, different services
Groups let two services use the same key name without clashing: {{host}} in a Payments request and {{host}} in a Billing request resolve to different values because they run with different environments. When one environment really needs hosts for several protocols, use specific keys (http_host, graphql_host, grpc_host).
A .env file for several groups
Secrets you don't want on the server can live in a local .env file, loaded with Load .env in the app or Requestarium: Load .env File… in VS Code. Prefixes target groups and environments:
PAYMENTS_HOST=http://127.0.0.1:8080 # host, any environment of group Payments
PAYMENTS_STAGING_TOKEN=sk_test_… # token, Payments / Staging only
BILLING_STAGING_TOKEN=… # token, Billing / Staging only
STAGING_LOG_LEVEL=debug # log_level, any environment named StagingWhen several prefixes give the same variable, group plus environment wins over environment, which wins over group. Values from the file stay in memory, are masked, never go to the server, and override the selected environment for your session.
In the CLI
The CLI picks environments by name or id. With groups, names often repeat ("Staging" in every group), so use the id when a name is ambiguous; requestarium env lists environments with their variables:
requestarium env
requestarium run-collection "Payments API" --env StagingMoving collections with their environments
Export as… ▸ Requestarium JSON lists the environment groups a collection uses and can include them in the file, so importing it on another server brings the groups along. See moving a collection and its environments.