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

# Environments

> Choose Production, QA, or Local without mixing identities or resources.

AIRCTRL environments are isolated. Accounts, OAuth Apps, Client IDs, client secrets,
access/refresh tokens, PATs, Service Account credentials, project IDs, gateway IDs, and runtime tokens
from one environment do not work in another.

## Environment URLs

| Environment | API base | Web app | OAuth discovery |
| - | - | - | - |
| Production | `https://api.airctrl.dev/v1` | `https://app.airctrl.dev` | `https://api.airctrl.dev/.well-known/oauth-authorization-server` |
| QA | `https://api.staging.airctrl.dev/v1` | `https://qa-app.airctrl.dev` | `https://api.staging.airctrl.dev/.well-known/oauth-authorization-server` |
| Local | `http://localhost:15430/v1` | `http://localhost:5174` | `http://localhost:15430/.well-known/oauth-authorization-server` |

Production is the default in public examples. Select QA when validating a release or partner
integration before Production. Local is for the AIRCTRL development stack only.

## Configure a client

Keep environment selection outside source code. Set `AIRCTRL_API_URL`, `AIRCTRL_API_ORIGIN`, and
`AIRCTRL_WEB_URL` from one row of the table above and store them in that environment's deployment
configuration. Do not combine values from different rows.

Use `AIRCTRL_API_URL` for raw `/v1` REST calls. `createClient`, gateway URL builders, OAuth discovery,
and `OAuthPartnerClient` use `AIRCTRL_API_ORIGIN`; the OAuth partner client also needs
`AIRCTRL_WEB_URL` for browser authorization.

## OAuth registration per environment

Create a separate OAuth App in each environment. Register the callback URI independently and store the
environment's Client ID and one-time client secret in separate secret-manager entries. The partner may
use the same callback route, but the authorization request, issuer validation, token endpoint, and
stored tokens must all come from one discovery document.

Never let a QA fallback silently call Production. Fail closed when the selected environment is missing
its own base URLs or credentials.

## API Reference selector

The generated API Reference exposes **Production** first and **QA** second in Mintlify's native server
selector. The selection updates operation URLs and generated request examples from the OpenAPI
`servers` contract. Local is intentionally absent because Mintlify's hosted API playground cannot
reach a developer's localhost. Authentication material must still belong to the selected environment.


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