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

# Environments

> Simulated health systems composed of linked simulators.

Environments represent simulated health systems. Each environment is composed of one or more [Simulators](/api-reference/resources/simulators) that work together to model a realistic healthcare setting (EHR, phone systems, fax, payers, etc.).

## Endpoints

| Method   | Endpoint                                                          | Description                             |
| -------- | ----------------------------------------------------------------- | --------------------------------------- |
| `GET`    | [`/environments`](/api-reference/endpoint/listEnvironments)       | List environments                       |
| `POST`   | [`/environments`](/api-reference/endpoint/createEnvironment)      | Create an environment                   |
| `GET`    | [`/environments/{id}`](/api-reference/endpoint/getEnvironment)    | Get environment details                 |
| `PATCH`  | [`/environments/{id}`](/api-reference/endpoint/updateEnvironment) | Update an environment                   |
| `DELETE` | [`/environments/{id}`](/api-reference/endpoint/deleteEnvironment) | Delete an environment                   |
| `POST`   | `/environments/{id}/simulators/{simulatorId}`                     | Add a simulator to the environment      |
| `DELETE` | `/environments/{id}/simulators/{simulatorId}`                     | Remove a simulator from the environment |

## Environment Object

| Field             | Type           | Description                 |
| ----------------- | -------------- | --------------------------- |
| `id`              | string         | Unique identifier           |
| `name`            | string         | Environment name            |
| `description`     | string \| null | Optional description        |
| `organization_id` | string         | Parent organization         |
| `created_at`      | datetime       | Creation timestamp          |
| `updated_at`      | datetime       | Last modification timestamp |

## SDK Example

```typescript theme={null}
// Create an environment
const env = await verial.environments.create({
  name: 'Regional Medical Center',
})

// List all environments
const environments = await verial.environments.list()

// Get a specific environment
const details = await verial.environments.get({ id: env.id })

// Update
await verial.environments.update({
  id: env.id,
  description: 'Primary care clinic with voice and FHIR',
})

// Link a simulator
await verial.environments.addSimulator({
  environmentId: env.id,
  simulatorId: 'sim_abc123',
})

// Unlink a simulator
await verial.environments.removeSimulator({
  environmentId: env.id,
  simulatorId: 'sim_abc123',
})

// Delete
await verial.environments.delete({ id: env.id })
```
