API Testing: Environments

API Testing: Environments

Overview

Use this page to create and manage API testing environments. An environment is a named set of a Base URL, default headers, variables, allowed hosts and a private-ranges toggle that tells an API test flow where to send its requests and what to send with them. Without an environment, a flow has no base address, credentials or reusable values to run against.

You create environments before building or running API flows: each flow run selects an environment to resolve its Base URL, inject its default headers and substitute its variables, including any marked secret. The same flow definition can then run unchanged against different environments, for example separate stages of the same API, by switching which environment it targets.

This page itself lists every environment with its Base URL and the number of headers and variables it holds, lets you search by name or Base URL, create a new environment, edit or view an existing one depending on your permissions, copy a Base URL, and delete environments no flow uses anymore.

Key concepts

  • environment - A named set of a Base URL, default headers, allowed hosts, a private-ranges toggle and variables that defines where and how an API test flow's requests are sent. (related: API Testing: API flows)
  • variable - A named, reusable value that flow steps can reference instead of a hardcoded value. It can be marked secret to mask its value in the editor. (related: API Testing: API flows)
  • allowed hosts - An allowlist of additional hostnames, beyond the Base URL's own host, that an environment's requests are permitted to reach.
  • secret variable - A variable whose value is masked by default in the environment editor and only shown when you select its reveal toggle.
  • allow private ranges - A per-environment toggle that permits requests to target private or internal IP address ranges instead of blocking them by default.

When to use it

  • Before running or scheduling an API flow against a new system under test, to give it a Base URL and default headers.
  • When different stages of the same API, such as staging and acceptance, need separate Base URLs for the same flow.
  • When a flow needs reusable values, such as endpoint paths or identifiers, without hardcoding them into every step.
  • When a credential such as an API key or token must be available to flow steps but hidden from casual view.
  • When a flow must reach an internal or non-public host and the environment needs private ranges allowed, or its outbound calls restricted to a specific set of hosts.
  • When cleaning up environments that no flow uses anymore.

Before you begin

  • Know the Base URL of the API you intend to test; this is created and hosted outside LoadGen.
  • Have any default headers or credentials the API requires (for example an authorization header or API key) ready to enter.
  • Your account needs environment-write permission to create, edit or delete environments; without it, row actions are disabled or open read-only.
  • If the target is a private or internal address, confirm this is intended before enabling Allow private ranges.

Common workflows

Create an environment for an API target

Persona: API test author or admin with environment-write permission

  1. Select Create environment.
    • Expect: The create environment form opens with empty Name, Base URL and Description fields and empty Headers, Allowed hosts and Variables lists.
  2. Enter a Name and a Base URL, for example "Puppis lunch-peak replay" and https://api.example.com.
    • Expect: Both required fields are filled in and no validation message is shown.
  3. Optionally select Add header to add a default header, or Add variable to add a reusable value, marking it secret if it holds a credential.
    • Expect: A new row appears in the Headers or Variables list with empty fields ready to fill in.
  4. Select Save.
    • Expect: The form closes, the list reloads, and the new environment appears as a row with its Name, Base URL and the Headers/Variables counts you configured.

Verify: The new row's Name and Base URL match what you entered, and the count badge next to the page title increases by one.

Restrict an environment's outbound requests

Persona: Admin tightening what a test environment can reach

  1. Select the Edit icon on the environment's row.
    • Expect: The edit form opens pre-filled with the environment's current Base URL, headers, allowed hosts and variables.
  2. Type a hostname in Allowed hosts and select Add host (or press Enter).
    • Expect: The hostname appears as a new entry in the Allowed hosts list.
  3. Leave Allow private ranges off, or turn it on only if the environment must reach an internal address.
    • Expect: The toggle reflects your choice; left off, requests to private IP ranges stay blocked.
  4. Select Save.
    • Expect: The form closes and the list reloads; the environment's Headers and Variables counts stay the same since only its host restrictions changed.

Verify: Reopening the environment's Edit form shows the new hostname still listed under Allowed hosts and the Allow private ranges toggle in the state you left it.

Delete an unused environment

Persona: Admin cleaning up stale environments

  1. Select the Delete icon on the environment's row.
    • Expect: A confirmation dialog opens asking Delete environment? naming the environment.
  2. Select Delete in the dialog.
    • Expect: The dialog stays open and busy while the request is sent, then closes once it succeeds.

Verify: The row no longer appears in the table and the count badge next to the page title decreases by one. If deletion is refused, the dialog stays open and shows the reason instead of closing.

Steps

Step 1

Open the Environments page under API Testing > Build.

Expected result: The page lists every configured environment with its Name, Base URL, Headers count and Variables count; a count badge next to the page title shows the total.

This list is the starting point for reviewing, creating or editing the environments that API test flows run against.

  • The Search field filters by name or base URL.
  • Create environment opens the form to add a new one.
  • Each row's Copy link copies its Base URL without opening the editor. API Testing: Environments - step 1

Field reference

Field Purpose Format / Validation Required Default
Search Filters the table to environments whose Name or Base URL matches every word typed. Use it to find a specific environment once the list grows too long to scan. free text No empty
Name Identifies the environment in the list and wherever it is selected for a flow. Choose a name specific enough to tell it apart from similar environments (for example which stage of the API it targets). free text Yes empty
Base URL The root address that flow requests resolve against when run under this environment. Changing it points every flow that uses this environment at a different server without editing the flow itself. URL Yes empty
Description Optional free-text note on what the environment is for, useful for telling similarly named environments apart. free text No empty
Headers Default name/value pairs sent with every request run under this environment, for example an authorization or content-type header. Add more headers to cover requirements every request in this environment shares; leave a row blank and it is dropped on save. list of key-value pairs No none configured
Allowed hosts An allowlist of additional hostnames, beyond the Base URL's own host, that this environment's requests may reach. Add an entry when a flow step must call another domain under this environment; fewer entries keep the environment's reach narrower. list of hostnames No empty list
Allow private ranges Permits this environment's requests to target private or internal IP addresses. Turn it on only when the Base URL or an allowed host is genuinely internal; leave it off to block requests to private ranges by default. toggle No off
Variables Named, reusable values flow steps can reference under this environment instead of hardcoding them. Mark a variable secret to mask its value in the editor and reveal it only on demand. list of key-value pairs, each with a secret flag No none configured

Column reference

Column What it shows How to read it
Name The environment's display name as configured. Use it to recognize the environment when selecting it for a flow run.
Base URL The environment's configured root address. Select the adjacent Copy link to copy this value without opening the editor.
Headers Count of default headers configured on the environment. A higher count means more headers are injected automatically into every request run under this environment; 0 means none are configured.
Variables Count of reusable variables configured on the environment. A higher count means more named values are available to flow steps under this environment; 0 means none are configured.
Actions Per-row Edit (or View) and Delete icons. If an icon is grayed out, hover it to read why; it usually means your role cannot change or delete environments.

Controls reference

Create environment

Opens an empty form to define a new environment's Name, Base URL, headers, variables and host restrictions.

When to use: When you need a new target for API flows to run against.

Side effects: Read-only until you select Save in the form; no environment is created yet.

Filters the table to rows whose Name or Base URL contains every typed word.

When to use: When the list holds more environments than you can scan at a glance.

Side effects: Read-only; the count badge next to the page title still reflects the total, not the filtered rows.

Views

Opens a menu of alternate ways to display the environments table.

When to use: When you want to change how the list is arranged.

Side effects: Read-only; does not change any stored environment data.

Help

Opens contextual help for the Environments page.

When to use: When you need guidance while on this page.

Side effects: Read-only.

Copy

Copies the row's Base URL to the clipboard.

When to use: When you need the URL elsewhere, such as in a browser, without opening the editor.

Side effects: Read-only; does not open the editor or change any data.

Edit / View

Opens the environment in the create/edit form, pre-filled with its Name, Base URL, Description, headers, allowed hosts, Allow private ranges and variables.

When to use: When you need to change an environment's settings, or review them when your role cannot change them.

Side effects: If your role lacks environment-write permission, the form opens read-only with Save withheld; otherwise, nothing is saved until you select Save.

Delete

Opens a confirmation dialog to permanently remove the environment.

When to use: When an environment is no longer used by any flow.

Side effects: Disabled, with a tooltip explaining why, if your role cannot delete environments; otherwise confirming the dialog deletes the environment and refreshes the list.

Add header

Adds a blank header row (name and value) to the form.

When to use: When the environment's requests need an additional default header.

Side effects: Local to the open form; not saved until you select Save.

Remove header

Removes a header row from the form.

When to use: When a default header is no longer needed.

Side effects: Local to the open form; not saved until you select Save.

Add host

Adds the typed hostname to the Allowed hosts list.

When to use: When a flow running under this environment must call an additional domain beyond the Base URL's host.

Side effects: Local to the open form; not saved until you select Save.

Remove host

Removes a hostname from the Allowed hosts list.

When to use: When an additional host is no longer required.

Side effects: Local to the open form; not saved until you select Save.

Show secret value

Toggles a secret variable's value between masked and visible text.

When to use: When you need to confirm or copy a secret variable's value.

Side effects: Read-only, display-only; does not change the stored value.

Add variable

Adds a blank variable row (name, value, and a secret checkbox) to the form.

When to use: When a flow needs a reusable value, such as an identifier or token, available under this environment.

Side effects: Local to the open form; not saved until you select Save.

Remove variable

Removes a variable row from the form.

When to use: When a variable is no longer needed.

Side effects: Local to the open form; not saved until you select Save.

Save

Validates that Name and Base URL are filled in, then creates a new environment or updates the one being edited.

When to use: After filling in or changing an environment's settings.

Side effects: Mutating: writes the environment, closes the form and refreshes the list; on failure (for example a clashing name) it shows the error in the form instead of closing.

Cancel

Closes the create/edit form without saving.

When to use: When you want to discard changes you started making.

Side effects: If any field, header, host or variable changed since the form opened, you are asked to confirm discarding changes; otherwise it closes immediately with nothing saved.

Delete (confirm)

Confirms permanent deletion of the environment named in the dialog.

When to use: After selecting Delete on a row you are sure is no longer needed.

Side effects: Mutating: the dialog stays open and busy while the request runs, shows an error and stays open if the delete is refused or fails, and closes and refreshes the list once it succeeds.

Verify the result

After saving, the environment appears as a row in the Environments table with the Name and Base URL you entered, and its Headers and Variables columns show the counts of what you configured. The count badge next to the page title increases by one for a new environment, or stays the same after an edit. If a save fails, the form stays open with an error message instead of closing, and the row in the table keeps its previous values. If an environment does not appear after what looked like a successful save, reopen Environments and use Search to confirm it was not saved under a different name or Base URL than expected.

Troubleshooting

  • Symptom: Save does nothing and an error reads "Name is required." or "Base URL is required." Fix: Fill in both fields; they are the only ones the form enforces before saving.
  • Symptom: The Edit form opens but every field is disabled and Save is withheld with a message that your role cannot change environments. Fix: You are viewing, not editing; ask an admin with environment-write permission to make the change.
  • Symptom: The Delete icon is grayed out on a row. Fix: Your role lacks permission to delete environments; request access or ask an admin to delete it.
  • Symptom: A variable's value shows as masked characters instead of plain text. Fix: Select the reveal toggle next to that variable to show it temporarily.
  • Symptom: Requests from a flow using this environment fail to reach an internal address. Fix: Open the environment and check whether Allow private ranges is on, or whether the target host is listed under Allowed hosts.
  • Symptom: Deleting an environment fails and the confirmation dialog stays open with an error. Fix: Read the message in the dialog; it is often refused because a flow still references the environment, so remove that reference first.
  • Next step: API Testing: API flows - a flow selects an environment to resolve the Base URL, headers and variables it runs with
  • See also: API Testing: Auth profiles - sibling Build configuration that supplies authentication alongside an environment's headers and variables
  • See also: API Testing: API sources - another reusable Build configuration referenced when setting up API flows
  • See also: API Testing: API Testing dashboard - module overview showing activity across the flows that use these environments
Was this article helpful?
0 out of 0 found this helpful