Skip to main content
PUT
/
analytics
/
widgets
/
{widget_id}
Update Widget
curl --request PUT \
  --url https://api.decodahealth.com/analytics/widgets/{widget_id} \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "chartType": "<string>",
  "queryConfig": {
    "table": "<string>",
    "fields": [
      "<string>"
    ],
    "filters": [
      {}
    ],
    "aggregations": {},
    "groupBy": [
      "<string>"
    ],
    "temporalGrouping": {},
    "orderBy": {}
  },
  "chartConfig": {},
  "layoutPosition": {},
  "isArchived": true,
  "orderIndex": 123
}
'
{
  "id": "<string>",
  "dashboardId": "<string>",
  "title": "<string>",
  "chartType": "<string>",
  "queryConfig": {
    "table": "<string>",
    "fields": [
      "<string>"
    ],
    "filters": [
      {}
    ],
    "aggregations": {},
    "groupBy": [
      "<string>"
    ],
    "temporalGrouping": {},
    "orderBy": {}
  },
  "layoutPosition": {},
  "isArchived": true,
  "orderIndex": 123,
  "createdDate": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "chartConfig": {},
  "updatedDate": "2023-11-07T05:31:56Z"
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Path Parameters

widget_id
string
required

Body

application/json

Schema for updating an existing dashboard widget.

title
string | null

Title of the widget

Maximum string length: 255
description
string | null

Description of the widget

chartType
string | null

Type of chart

Maximum string length: 50
queryConfig
QueryConfigSchema · object

Query builder configuration

chartConfig
Chartconfig · object

Chart-specific configuration

layoutPosition
Layoutposition · object

Grid position and size

isArchived
boolean | null

Whether the widget is archived

orderIndex
integer | null

Order index for widget positioning

Response

Successful Response

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

chartType
string
required

Type of chart

queryConfig
QueryConfigSchema · object
required

Query builder configuration

layoutPosition
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

description
string | null

Description of the widget

chartConfig
Chartconfig · object

Chart-specific configuration

updatedDate
string<date-time> | null

When the widget was last updated