Skip to main content
PATCH
/
api
/
public
/
organizations
/
{orgId}
/
charts
/
{id}
Update a chart
curl --request PATCH \
  --url https://charts.basedash.com/api/public/organizations/{orgId}/charts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dashboardId": "<string>",
  "dashboardTabId": "<string>",
  "layout": {
    "x": 1,
    "y": 1,
    "width": 2,
    "height": 2
  },
  "name": "<string>",
  "description": "<string>",
  "chartType": "TABLE",
  "sqlQuery": "<string>",
  "drilldownSqlQuery": "<string>",
  "databaseConnectionId": "<string>",
  "xAxisProperty": "<string>",
  "xAxisSecondaryProperty": "<string>",
  "yAxisProperty": "<string>",
  "staticContent": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "dashboardId": "<string>",
    "dashboardTabId": "<string>",
    "organizationId": "<string>",
    "name": "<string>",
    "description": "<string>",
    "chartType": "TABLE",
    "sqlQuery": "<string>",
    "drilldownSqlQuery": "<string>",
    "databaseConnectionId": "<string>",
    "xAxisProperty": "<string>",
    "xAxisSecondaryProperty": "<string>",
    "yAxisProperty": "<string>",
    "staticContent": "<string>",
    "layout": {
      "x": 1,
      "y": 1,
      "width": 2,
      "height": 2
    }
  }
}

Authorizations

Authorization
string
header
required

API key authentication using Bearer token format: Bearer <basedash_api_key>

Path Parameters

orgId
string
required

Organization ID

id
string
required

Chart ID

Body

application/json
dashboardId
string

ID of the dashboard to move the chart to

dashboardTabId
string

ID of the dashboard tab to move the chart to

layout
object

Position and size of the chart on the dashboard grid

name
string

Name of the chart

Minimum string length: 1
description
string | null

Description of the chart

chartType

Type of the chart

Available options:
TABLE
sqlQuery
string

SQL query powering the chart

drilldownSqlQuery
string | null

SQL query used for chart drill-downs

databaseConnectionId
string | null

ID of the data source the SQL query runs against

xAxisProperty
string | null

Result column used for the x-axis

xAxisSecondaryProperty
string | null

Result column used to break down the x-axis into segments

yAxisProperty
string | null

Result column used for the y-axis

staticContent
string | null

Static content for DASHBOARD_HEADER and DASHBOARD_TEXT chart types

Response

Chart updated successfully

data
object
required