# Get an environment

> Its name and each variable's name and last four characters.

`GET https://api.zavu.dev/v1/sandbox-environments/{environmentId}`

Its name and each variable's name and last four characters.

## Parameters

- `environmentId` (path, string, required): Sandbox environment ID.

## Responses

### 200

The environment.

- `environment` (object, required): A named set of environment variables to start sandboxes with. Values are encrypted at rest and never returned.
  - `id` (string, required)
  - `name` (string, required)
  - `variables` (object[], required): Each variable's name and the last four characters of its value.
    - `key` (string, required)
    - `last4` (string, required)
  - `createdAt` (string<date-time>, required)
  - `updatedAt` (string<date-time>, required)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Environment not found, or it belongs to another project.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/sandbox-environments/environment_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.sandboxes.environments.retrieve("environment_abc123");

console.log(result);
```
