---
title: "Deactivate Environment"
method: POST
path: "/environments/{env_id}/deactivate"
---

# Deactivate Environment

`POST /environments/{env_id}/deactivate`

## Request

- Base URL: `https://api-docs.session-exchange.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.session-exchange.com/environments/{env_id}/deactivate`
- Auth: none declared

Retire an environment: mark its record `status=deactivated`. The default
environment can't be deactivated (it owns the pre-existing stations).

2e — the data plane: by default this is a record-level flag only, and the env's
stations keep emitting (the contradiction the crypto-portfolio deactivation hit).
Pass `?cascade_stations=true` to also QUARANTINE the env's stations — reassign
them to an inert ``_retired:<env>`` environment so their events stop folding into
any active env's model. Reversible: reassign a station's environment to restore it.

## Path parameters

- `env_id` string, required

## Query parameters

- `cascade_stations` boolean

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/session-exchange/apis/a4sx.md) · [All operations](https://skmtc.dev/session-exchange/apis/a4sx/llms.txt) · [OpenAPI document](https://skmtc.dev/session-exchange/apis/a4sx/revisions/abaefc33dfc7?raw)
