V3 Dashboards

Move a widget or show another chart in it

Changed on

Moves or resizes a widget, points it at another chart, or both. A layout covering another widget answers 422 naming it; a chart already on the dashboard answers 409. Moves the dashboard's updatedAt. Needs write access to the dashboard's workspace.

patch/api/v3/dashboards/{dashboardId}/widgets/{widgetId}

Request

  • Base URL
    https://app.formbricks.com
  • URL
    https://app.formbricks.com/api/v3/dashboards/{dashboardId}/widgets/{widgetId}
  • Auth
    • API key in cookie next-auth.session-token
    • or API key in header x-api-key
    • or HTTP bearer

Path parameters

dashboardIdstring cuid2 required

Dashboard identifier.

widgetIdstring cuid2 required

The widget's id, from the dashboard's widgets.

Request body

chartIdstring cuid2

A chart in the dashboard's workspace that is not already on the dashboard.

Response

The updated widget

Example response

{
  "data": {
    "chart": {
      "query": {
        "measures": [
          "FeedbackRecords.npsScore"
        ],
        "dimensions": [
          "FeedbackRecords.sourceName"
        ],
        "timeDimensions": [
          {
            "dimension": "FeedbackRecords.collectedAt",
            "dateRange": "last 30 days"
          }
        ],
        "filters": [
          {
            "member": "FeedbackRecords.sourceType"
          }
        ]
      }
    }
  }
}

Changes