V3 Charts

Edits a chart's name, type, chart query or display settings. The chart may sit on several dashboards (dashboards in the response), and the edit shows on every one of them — duplicate the chart and repoint one dashboard's widget to change it there only. A chart's Feedback Dataset cannot change. Needs write access to the chart's workspace and, while its Feedback Dataset is assigned to that workspace and not archived, to the dataset, as a delete does. Once the dataset is unassigned or archived, the chart can still be renamed or restyled, but its query and type can no longer change.

patch/api/v3/charts/{chartId}

Request

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

Path parameters

chartIdstring cuid2 required

Chart identifier.

Request body

namestring
type'area' | 'bar' | 'pie' | 'big_number' | 'matrix'

Example request

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

Response

The updated chart

Example response

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

Changes