---
title: "Update Widget"
method: PUT
path: "/analytics/widgets/{widget_id}"
tags: ["provider", "analytics", "analytics"]
---

# Update Widget

`PUT /analytics/widgets/{widget_id}`

Update a dashboard widget.

## Path parameters

- `widget_id` string, required

## Headers

- `TENANT` string, required
- `API-KEY` string, required

## Request body

- UpdateWidgetSchema — Schema for updating an existing dashboard widget.
  - `title` string, nullable — Title of the widget
  - `description` string, nullable — Description of the widget
  - `chartType` string, nullable — Type of chart
  - `queryConfig` QueryConfigSchema — Schema for query configuration.
    - `table` string, required — Table name to query
    - `fields` string[], required — List of fields to select
    - `filters` object[], nullable — Optional filters to apply
    - `aggregations` object, nullable — Optional aggregations to apply
    - `groupBy` string[], nullable — Optional fields to group by
    - `temporalGrouping` object, nullable — Optional temporal grouping for date fields
    - `orderBy` object, nullable — Optional ordering configuration
  - `chartConfig` object, nullable — Chart-specific configuration
  - `layoutPosition` object, nullable — Grid position and size
  - `isArchived` boolean, nullable — Whether the widget is archived
  - `orderIndex` integer, nullable — Order index for widget positioning

## Response `200`

Successful Response

- DashboardWidgetSchema — Schema for dashboard widget response.
  - `id` string, required — Unique identifier for the widget
  - `dashboardId` string, required — ID of the dashboard this widget belongs to
  - `title` string, required — Title of the widget
  - `description` string, nullable — Description of the widget
  - `chartType` string, required — Type of chart
  - `queryConfig` QueryConfigSchema, required — Schema for query configuration.
    - `table` string, required — Table name to query
    - `fields` string[], required — List of fields to select
    - `filters` object[], nullable — Optional filters to apply
    - `aggregations` object, nullable — Optional aggregations to apply
    - `groupBy` string[], nullable — Optional fields to group by
    - `temporalGrouping` object, nullable — Optional temporal grouping for date fields
    - `orderBy` object, nullable — Optional ordering configuration
  - `chartConfig` object, nullable — Chart-specific configuration
  - `layoutPosition` object, required — Grid position and size
  - `isArchived` boolean, required — Whether the widget is archived
  - `orderIndex` integer, required — Order index for widget positioning
  - `createdDate` string, date-time, required — When the widget was created
  - `updatedDate` string, date-time, nullable — When the widget was last updated

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/decodahealth/apis/decoda-api.md) · [All operations](https://skmtc.dev/decodahealth/apis/decoda-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/decodahealth/decoda-api/revisions/4939a65a89d2/schema)
