# Get Environment as YAML

`GET /workspaces/:workspace/environments/:environment_id/yaml`

Get environment YAML

**Required Scopes:** `ENVIRONMENT_READ`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The ID of the environment */
  environment_id: string; // Example: "3a4KbBQl"
}
```

## Response Body

```typescript
interface ResponseBody {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The Base64-encoded YAML definition of the environment */
  yaml?: string;
}
```

## Response Example

**Status:** `200 OK`

```json
{
  "yaml": "LSBlbnZpcm9ubWVudDo..."
}
```

---
Original source: https://buddy.works/docs/api/environment/get-as-yaml