V3 Charts

Duplicate a chart

Changed on

Copies a chart — same Feedback Dataset, type, chart query and display settings — so the copy can change without touching the dashboards that show the original. With dashboardId, the copy is also put on that dashboard (first open slot, or layout) in the same transaction, and the dashboard's updatedAt moves; a dashboard already holding 250 widgets, or with no open slot above the grid's last row, answers 409 and no copy is made. Needs write access to the chart's workspace and to its Feedback Dataset.

post/api/v3/charts/{chartId}/duplicate

Request

  • Base URL
    https://app.formbricks.com
  • URL
    https://app.formbricks.com/api/v3/charts/{chartId}/duplicate
  • 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

Name for the copy, unique within the workspace. Without one the copy is named "<original> (copy)", then "(copy 2)" and so on.

dashboardIdstring cuid2

Also put the copy on this dashboard, in the same transaction: if placing it fails, no copy is left behind. Must be in the chart's workspace.

Response

The copy

Example response

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

Changes