# Environments for API Checks

Source: https://www.observeone.com/blog/api-check-environments

[Blog](/blog)/Environments for API ChecksTestingBeginner

# Environments for API Checks

ObserveOne environments hold shared variables and write-only secrets per project. Switch a check between staging and production without editing it.

ObserveOne Team

July 15, 2026

2 min read

The same check often needs to run against staging with one token and
production with another. Environments solve this in ObserveOne: named sets of
variables and secrets a check resolves at run time, so one definition serves
every target.

## What an environment holds[#](#what-an-environment-holds)

VariablesSecrets

Stored asplain valueswrite-only values

Read back asfull valueskey names only

Good forhosts, paths, tenant IDstokens, passwords, API keys

Once a secret is saved, no screen or API response returns its value again;
sending an empty value deletes the key.

## How checks use them[#](#how-checks-use-them)

Reference any key as {{KEY}} in a check&#x27;s URL, headers, or body:

Copy

GET {{BASE_HOST}}/v2/orders

Authorization: Bearer {{API_TOKEN}}

GET {{BASE_HOST}}/v2/orders

Authorization: Bearer {{API_TOKEN}}

Resolution happens server-side at send time. Imported [.http
files](/blog/http-files-api-testing) keep their {{refs}} intact, so they
drop in without rewriting.

## Scoping[#](#scoping)

An environment is attached to one project, or to none:

- Project-scoped: appears only in that project&#x27;s picker; one project&#x27;s
tokens never show up in another.

- Owner-global (no project): appears in every project&#x27;s API checks, for
values shared across all your work.

## Limitations[#](#limitations)

- Picking an environment applies to the API check run you trigger; scheduled
check runs do not use one yet.

Selection lives in the run you trigger, not on the check.

- No version history for edits: changing a value changes the next run.

## Getting started[#](#getting-started)

1. Create one environment per deploy target (Staging, Production).

2. Put hosts and IDs in variables, every credential in secrets.

Variables are readable; secrets come back as key names only.
3. Replace hardcoded values in the check with {{KEY}}.

4. Pick the environment in the check&#x27;s switcher and send.

The same vault feeds [ObserveOne&#x27;s
Autopilot](https://app.observeone.com/playwright-autopilot): generated
Playwright tests log in via process.env.KEY, never a literal password.

## Frequently Asked Questions

Can two environments use the same key name with different values?Yes, that is the core mechanic. Staging and Production can both define API_TOKEN or BASE_HOST with their own values, and a check written once with placeholders resolves whichever set is active. Keeping key names identical across environments is what makes switching a one-click operation.

Can two projects use the same environment?An environment is either attached to one project or owner-global. Owner-global environments are visible everywhere, so shared staples like a company-wide base host can live there while project-specific values stay scoped to their project.

What happens to a check if its selected environment is deleted?The reference simply falls away and placeholders stop resolving from that set. Nothing else on the check changes, and picking another environment restores resolution. Values from a deleted environment are not cached on the check.

[Previous← The Alert That Never Fired](/blog/the-alert-that-never-fired)[NextHow Monitoring Secrets Are Encrypted at Rest →](/blog/monitoring-secrets-encrypted-at-rest)

## Related Posts

[TestingTesting APIs with .http Files.http files let you test APIs as plain text in your editor. Learn the syntax, variables, and how to run them in VS Code, IntelliJ, and CI.](/blog/http-files-api-testing)[MonitoringAPI Testing Tools: The 2026 Guide by Testing TypeFunctional, load, and security testing need different API testing tools. A practical breakdown of what to use for each, plus a buyer&#x27;s guide to picking your daily-driver client.](/blog/how-to-choose-api-testing-tool)[MonitoringBest API Monitoring Tools for 2026The best API monitoring tools for 2026, compared on alerting, dashboards, and price, with picks for developer and QA teams watching live APIs.](/blog/api-monitoring-tools)

## Ready for AI-Powered Testing?

ObserveOne monitors your selectors 24/7 and automatically heals them when websites change. Never deal with broken tests again.

[Start Free Trial](https://app.observeone.com/auth?tab=signup)
