# Get a dashboard's raw YAML

> Source: https://docs.clonepartner.com/api-reference/dashboards/get-dashboard-yaml/

`GET /api/dashboards/{id}/yaml`

Returns the snapshotted dashboard YAML for editing. Admin only.

**Operation ID:** `getDashboardYaml`

## Authentication

### Option 1

- **BearerAuth** (`http bearer`)
  API key token. Create via POST /api/api-keys. Format: `envoy_<hex>`

### Option 2

- **CookieAuth** (`apiKey`)
  Session cookie set after login + TOTP verification

## Path parameters

- `id` — `integer`, `required`
  Resource ID

## Success responses

### 200

Raw dashboard YAML

**Content type:** `application/json`

- Type: `object`
- Properties:
  - `id` (`integer`)
  - `name` (`string`)
  - `description` (`string | null`)
    - Nullable: yes
  - `yaml_content` (`string`)
  - `job_id` (`integer`) — Parent job id (used for post-delete navigation)

## Error responses

### 404

Resource not found

**Content type:** `application/json`

- Reference: `Error`
  - Type: `object`
  - Properties:
    - `error` (`string`)
      - Example: `NOT_FOUND`
    - `message` (`string`)
      - Example: `Resource not found`

Example:

```json
{
  "error": "NOT_FOUND",
  "message": "Resource not found"
}
```

## Examples

### cURL

```bash
curl --request GET \
  --url 'https://your-envoy.example.com/api/dashboards/YOUR_ID/yaml' \
  --header 'Authorization: Bearer $API_KEY'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/dashboards/YOUR_ID/yaml', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
});

if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);
```
