> This page is for Revenue Guard.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://revenue-docs.creliohealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://revenue-docs.creliohealth.com/_mcp/server.

# Environments

Revenue Guard separates every organization's data into two environments: **sandbox** and **live**. Payers, rules, orders, webhooks, and logs are all scoped to one environment, so test traffic never mixes with production data.

## How the environment is chosen

The environment is decided by the credential, not by a request parameter.

* **API callers** — the API key is authoritative. A sandbox key reads and writes sandbox data; a live key reads and writes live data. There is no environment header, and there is no way for a key to reach the other environment.
* **Dashboard users** — a live/sandbox switcher at the top of the app sets the active environment for your session. Every page (Orders, Payers, Rules, API Keys, Webhooks, Logs) reflects the environment you have selected.

> **Note**
>
> Do not send a separate environment header on API requests. The API key determines sandbox versus live routing on its own.

## Key prefixes

Every API key is bound to a single environment when it is created, and its prefix tells you which one:

| Key prefix | Environment | Reads / writes    |
| ---------- | ----------- | ----------------- |
| `rg_test_` | Sandbox     | Sandbox data only |
| `rg_live_` | Live        | Live data only    |

## Confirming which environment processed a request

Responses that create or update environment-owned resources include two fields you can assert on:

* `environment` — `sandbox` or `live`.
* `livemode` — `true` only when the request used a live key.

For example, an order submitted with a sandbox key returns:

```json
{
  "environment": "sandbox",
  "livemode": false
}
```

## Recommended workflow

#### Build against sandbox

Develop and test your integration with a `rg_test_` key. Seed sandbox payers, submit test orders, and verify your webhook receiver against sandbox deliveries.

#### Verify end to end

Confirm payer lookup, order submission, validation handling, and webhook processing all behave as expected in sandbox.

#### Promote to live

Create a `rg_live_` key, swap the credential in your production configuration, and repeat a smoke test. No code changes are required — only the key changes.

![Environment switcher](/_fern-files/creliohealth.docs.buildwithfern.com/cc596961d248350345ea3e34e87ce6bd102273961e48fb2f5e971924e7432be1/docs/assets/screenshots/placeholder.svg)

> **Note**
>
> Need help with a Revenue Guard integration? Contact your CrelioHealth implementation or account team with the endpoint, timestamp, and request trace details.