# List the options behind a form field or action input

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

`POST /dashboard/{id}/widget/{key}/options`

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

## Path parameters

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

## Request body

- **`q`** _(string)_
  Substring search. Honored only when the page reports searchable.
- **`cursor`** _(string)_
- **`limit`** _(integer)_
- **`deps`** _(object)_
  Values of the fields this lookup depends on.
- **`field`** _(string)_

## Response body

- **`result`** _(array<object>)_
  - **`value`** _(unknown)_
  - **`label`** _(string)_
  - **`subtext`** _(string,null)_
- **`next_cursor`** _(string,null)_
- **`prev_cursor`** _(null)_
- **`searchable`** _(boolean)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/dashboard/<id>/widget/<key>/options' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"q":"your_q","cursor":"your_cursor","limit":0,"deps":{},"field":"your_field"}'
```

### JavaScript

```javascript
const body = {
  "q": "your_q",
  "cursor": "your_cursor",
  "limit": 0,
  "deps": {},
  "field": "your_field"
};

const response = await fetch('https://api.elaichi.ai/dashboard/<id>/widget/<key>/options', {
  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>/widget/<key>/options"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "q": "your_q",
    "cursor": "your_cursor",
    "limit": 0,
    "deps": {},
    "field": "your_field"
}

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