> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useboom.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Keep staging and production URLs out of your journeys: define them once per environment and switch which one a journey calls.

An **environment** is a named set of values, such as a base URL, a host or a tenant
id, that HTTP request nodes and webhook URLs read as `{{env.<key>}}`. Give
`production` and `staging` the same keys with different values. To move a journey
from one system to the other, you change the environment it uses and leave the
nodes as they are.

Environments hold **plain, non-secret configuration only**. API keys and tokens go
in **Settings → HTTP Credentials**, which can hold a different secret per
environment (see [Credentials per environment](#credentials-per-environment)).

## Create an environment

**1. Open Settings → Environments**

Click **New environment** and give it a name (`staging`) and a color. The
color is how you'll recognize it in the journey toolbar.

**2. Add variables**

Each variable is a key and a value, for example `baseUrl` →
`https://api-staging.example.com`. Keys use letters, numbers and underscores
and must start with a letter or underscore. Hyphens and dots aren't allowed.
Use the **same keys** in every environment so that switching never leaves a
node with a missing value.

**3. Pick a default**

The **Default environment** is the one a journey uses when it has none
selected. Your organization has exactly one default. The first environment
you create becomes it.

> [!WARNING]
>
> Variable values are stored **unencrypted** and are visible to anyone who can
> open this page. If a value looks like a token, Boom warns you. Move it to HTTP
> Credentials.

## Use a variable in an HTTP request node

Reference a key as `{{env.<key>}}` in the node's URL, headers or body:

```text theme={null}
POST {{env.baseUrl}}/notifications/send
```

* **In the URL**, the value is inserted exactly as written and is not
  URL-encoded, so a value like `https://api.example.com/v1` works as a prefix.
  Customer and person fields in the URL *are* encoded.
* **In headers**, line breaks are removed. **In a JSON body**, the value is
  escaped as a JSON string.

Values from an earlier node's response and customer fields are covered in
[Template variables](https://docs.useboom.ai/template-variables.md).

## Choose the environment a journey calls

Each journey has an environment switcher in its toolbar. The environment
selected there is the one its HTTP request nodes use, both when you test a node
and when the journey runs. If none is selected, `{{env.<key>}}` values come from
the default environment. Credentials work a little differently; see
[Credentials per environment](#credentials-per-environment).

> [!WARNING]
>
> **The environment is locked in when you publish.** Whichever environment is
> selected when you click **Publish** is the one the live journey calls, until you
> publish again. A journey published with `staging` selected keeps calling
> staging for real customers. Check the switcher before you publish.

Locking it in also means changing the organization's default later doesn't
silently redirect a live journey. Publishing with another environment selected
adds a second live version for that environment; it doesn't stop the first.

Boom checks the selected environment when you publish and refuses if:

* the selected environment no longer exists, or
* a node uses an `{{env.<key>}}` that this environment doesn't define. This catches
  a key you added only to staging and then published against production.

### What happens after you edit an environment

* **Adding** a variable is always allowed.
* **Removing or renaming** a key that a published journey still uses is refused,
  because every node using it would start sending a blank value.
* **Changing a value** applies to runs that start afterwards. Runs that are
  already in progress (for example, waiting on a delay) keep the values they
  started with.
* **Deleting** an environment is refused while a published journey uses it or a
  conversation is still running in it.

## Credentials per environment

A credential in **Settings → HTTP Credentials** can have a **Global** value and an
override for each environment. When a node runs, Boom uses the override for that
environment if there is one, and otherwise the Global value. If neither exists,
the node fails. Use this when staging and production need different API keys
behind the same credential name.

A credential follows the environment **selected on the journey**. If none is
selected:

* **Testing a node** uses the Global value.
* **Publishing** a journey whose nodes use `{{env.<key>}}` locks it to the default
  environment, so its live runs use that environment's override (or Global if it
  has none).
* **Publishing** a journey with no `{{env.<key>}}` uses the Global value.

If a credential has per-environment overrides, select an environment on every
journey that uses it, so tests and live runs use the same value.

## The `test` environment

Boom creates an environment named `test` automatically and uses it to mark
test sends. It isn't a sandbox. A journey's
HTTP request nodes still call the environment selected in that journey's
toolbar. To reach a development system, create your own environment (for example
`staging`) with its URLs, and select it on a journey you use only for testing.

## Webhooks and agent tools

* **Webhook** URLs can use `{{env.<key>}}` too. One destination covers every
  environment, and **View webhooks** on an environment's row shows the URL each
  subscription builds there and whether its credential resolves. See
  [Webhooks](https://docs.useboom.ai/webhooks.md).
* **Agent tools** use the default environment. Tools that follow the
  conversation's environment are available on request; see
  [The agent](https://docs.useboom.ai/the-agent.md).
* Over the API and MCP, `environments_list` returns each environment's name,
  whether it's the default, and its variable **keys**. Values aren't returned.

## Related

> [card] [Journeys](https://docs.useboom.ai/journeys.md)
>
> Build the flow your HTTP request nodes live in.

> [card] [Template variables](https://docs.useboom.ai/template-variables.md)
>
> Everything else a node's URL and body can read.

> [card] [Webhooks](https://docs.useboom.ai/webhooks.md)
>
> Get a POST when a run starts, ends, or is handed to a human.

> [card] [The agent](https://docs.useboom.ai/the-agent.md)
>
> Agent tools and the environment they call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.