# Preview what a public link would expose

> Source: https://elaichi.ai/docs/api-reference/dashboards/dashboard/previewpubliclink/

`POST /dashboard/{id}/public-link/preview`

Resource: **Dashboard** · API: **Dashboards**

## Path parameters

- **`id`** _(string, required)_
  Resource id

## Request body

- **`pages`** _(array<string>)_
  Page keys; all pages when left out.
- **`forms_enabled`** _(boolean)_
  Preview with forms on.
- **`rows_editable`** _(boolean)_
  Preview with row edits on. Ignored unless forms_enabled is true.

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/dashboard/<id>/public-link/preview' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"pages":[],"forms_enabled":true,"rows_editable":true}'
```

### JavaScript

```javascript
const body = {
  "pages": [],
  "forms_enabled": true,
  "rows_editable": true
};

const response = await fetch('https://api.elaichi.ai/dashboard/<id>/public-link/preview', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/dashboard/<id>/public-link/preview"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "pages": [],
    "forms_enabled": True,
    "rows_editable": True
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```
