> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/api-reference/guides/environments.md).

# Environments

How a REST call chooses the environment (PROD, TEST, …) of a project.

A project has one or more environments — **PROD** always, and others such as **TEST** that you add in Cloud. Each environment has its own integrations (its own database, its own email provider, …), so the same call can read different data in PROD and in TEST.

## How Norbix models it

| You send                                                  | The call works in                              |
| --------------------------------------------------------- | ---------------------------------------------- |
| nothing                                                   | **PROD** — with a sign-in token and with a key |
| `env=PROD` query parameter or `"env": "PROD"` in the body | PROD                                           |
| `norbix-env: TEST` header                                 | TEST                                           |

* Names are not case-sensitive (`prod` = `PROD`). A name that is not 1–15 letters, digits or spaces is refused with `CM-ERRORS-PROPERTY-002` ("Environment name 'te-st' is invalid: only letters, digits and spaces are allowed") — it never silently falls back to PROD.
* An environment that has no database integration answers `CM-ERRORS-INTEGRATIONS-006` "There is no active default integration".

Read from TEST with a header:

```sh
curl -s "https://api.norbix.ai/v3/database/collections/books?projectId=pr_6JMU7afJi9tZQwfo6de4qq" \
  -H "Authorization: Bearer $NORBIX_API_KEY" \
  -H "norbix-env: TEST"
```

Read from PROD — send no environment:

```sh
curl -s "https://api.norbix.ai/v3/database/collections/books?projectId=pr_6JMU7afJi9tZQwfo6de4qq" \
  -H "Authorization: Bearer $NORBIX_API_KEY"
```

The SDK and the CLI leave the `norbix-env` header out for PROD, so their calls read PROD unless you choose another environment.

Manage environments: Cloud → Project → Settings → **Environments**, or the Hub endpoints [Create project environment](/codemash/api-reference/account/projects/create-project-environment.md), [Get project environments](/codemash/api-reference/account/projects/get-project-environments.md), [Delete project environment](/codemash/api-reference/account/projects/delete-project-environment.md), [Promote environment](/codemash/api-reference/account/projects/promote-environment.md).

## Where you use it

* [Keys and environments](/codemash/get-started/keys-and-environments.md#environments) · [Projects and environments](/codemash/cloud/concepts/projects-and-environments.md)
* Cloud: [Environments tab](/codemash/cloud/project/settings/environments.md)
