# Save an input-widget config value on a shared dashboard

> Source: https://docs.clonepartner.com/api-reference/public-dashboards/save-public-dashboard-widget-config/

`PUT /api/public/dashboards/{token}/widgets/{widgetId}/config`

Mirror of PUT /api/dashboards/{id}/widgets/{widgetId}/config. Gated by the
kill switch (503) and `allow_public_input` (403). Writes use updated_by='public'.

**Operation ID:** `savePublicDashboardWidgetConfig`

## Authentication

No authentication is required.

## Path parameters

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

## Request body

The request body is required.

### `application/json`

- Reference: `WidgetConfigRequest`
  - Type: `object`
  - Properties:
    - `value` (`unknown`, `required`) — Persisted value for the widget. field_mapping → array of `{ source_field, target_field, transform? }`; form → object keyed by field key.

## Success responses

### 200

Saved

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

- Type: `object`
- Properties:
  - `ok` (`boolean`)

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

### 403

Public input not enabled for this dashboard


### 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 dashboard input disabled on this server


## Examples

### cURL

```bash
curl --request PUT \
  --url 'https://your-envoy.example.com/api/public/dashboards/YOUR_TOKEN/widgets/YOUR_WIDGET_ID/config' \
  --header 'Content-Type: application/json' \
  --data '{
  "value": "string"
}'
```

### JavaScript (fetch)

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

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