# Execute multiple widget data queries on a shared dashboard

> Source: https://docs.clonepartner.com/api-reference/public-dashboards/execute-public-dashboard-widgets/

`POST /api/public/dashboards/{token}/widgets/data`

Execute multiple widget data queries on a shared dashboard

**Operation ID:** `executePublicDashboardWidgets`

## Authentication

No authentication is required.

## Path parameters

- `token` — `string`, `required`

## Request body

### `application/json`

- Type: `object`
- Properties:
  - `widget_ids` (`array<string>`)
    - Items:
      - Type: `string`

## Success responses

### 200

Per-widget data or errors

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

- Reference: `WidgetBatchDataResponse`
  - Type: `object`
  - Properties:
    - `widgets` (`object`)
      - Additional properties:
        - Reference: `WidgetBatchItem`
          - Type: `object`
          - Properties:
            - `data` (`unknown`) — Widget-specific payload when the query succeeded
            - `error` (`string`) — Error message when this widget failed (other widgets may still succeed)

## Error responses

### 400

Validation error

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

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

Example:

```json
{
  "error": "VALIDATION_ERROR",
  "message": "Invalid input"
}
```

### 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"
}
```

### 503

Public dashboards disabled on this server


## Examples

### cURL

```bash
curl --request POST \
  --url 'https://your-envoy.example.com/api/public/dashboards/YOUR_TOKEN/widgets/data' \
  --header 'Content-Type: application/json' \
  --data '{
  "widget_ids": [
    "string"
  ]
}'
```

### JavaScript (fetch)

```javascript
const response = await fetch('https://your-envoy.example.com/api/public/dashboards/YOUR_TOKEN/widgets/data', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "widget_ids": [
      "string"
    ]
  }),
});

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