You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Ruchitha598 (via GitHub)" <gi...@apache.org> on 2025/11/04 09:15:46 UTC
[D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
GitHub user Ruchitha598 created a discussion: Is there an API in Superset to retrieve chart structure for chart creation?
Hi team,
I wanted to check if Apache Superset provides any API to retrieve the chart structure or template that defines the mandatory parameters required to create a chart.
For example, when creating a chart via the Superset Chart API by passing the chart JSON, I’d like to know if there’s an API endpoint that returns the expected or default chart structure (i.e., the required fields and their formats) needed to build a valid chart JSON payload.
I’m looking for something that could return a structure like this:
"example_params": {
"datasource": "{id}__table",
"viz_type": "pivot_table_v2",
"metrics": ["<METRIC>"],
"groupbyRows": ["<DIMENSION_COLUMN>"],
"groupbyColumns": ["<DATE_OR_CATEGORY_COLUMN>"],
"adhoc_filters": ["<FILTERS>"],
"aggregatorName": "Sum",
"transposePivot": false,
"combineMetric": false,
"row_limit": 1000,
"result_format": "json",
"result_type": "full"
}
Is there any Superset API that can return this kind of chart parameter structure or schema (per viz_type) that helps in dynamically generating or validating chart JSONs for creation?
Superset version 4.1.1
Thanks in advance for any guidance!
GitHub link: https://github.com/apache/superset/discussions/35978
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Is there an API in Superset to retrieve chart structure for chart creation?
<!-- Answer -->
Yes, you can retrieve the chart's params field (the JSON parameters used for that chart) using a few indirect API methods, but only for existing charts—not as a generic template per viz_type.
- The GET /api/v1/chart/{id_or_uuid} endpoint returns all details for a specific chart, including the params field with the chart's configuration as JSON. This is the most direct way to get the params for any existing chart by its ID or UUID [(source)](https://github.com/apache/superset/pull/29573).
- If you want to get params for all charts on a dashboard, you can use GET /api/v1/dashboard/{id_or_slug}/charts, which returns a list of charts (and their params) for that dashboard [(source)](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
- You can also export dashboards using GET /api/v1/dashboard/export/, which includes all associated charts and their params in the exported YAML files [(source)](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
There is no API that returns a generic or default chart params structure for a given viz_type—these APIs only return params for charts that already exist.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ff0cc5fe-0434-4e12-a660-a2e0034d81ca?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35978)
GitHub link: https://github.com/apache/superset/discussions/35978#discussioncomment-14867728
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Is there an API in Superset to retrieve chart structure for chart creation?
<!-- Answer -->
Superset does not provide an API endpoint that returns a generic chart parameter structure or schema per viz_type for chart creation. The Chart API expects you to construct the payload manually, specifying required fields like `slice_name`, `datasource_id`, `datasource_type`, and optionally `viz_type` and `params` (which is a JSON string containing chart-specific parameters) [reference](https://github.com/apache/superset/discussions/34750) [reference](https://github.com/apache/superset/blob/master/superset/charts/schemas.py).
There is no endpoint that returns a template or schema of required chart parameters per viz_type. The backend schemas (like `ChartPostSchema`) define the general structure for chart creation, but do not provide per-viz_type details [reference](https://github.com/apache/superset/blob/master/superset/charts/schemas.py). The frontend chart plugins define their control panel configuration (parameters, controls, defaults, validation) in static TypeScript files (e.g., `controlPanel.ts`), but this is not exposed via an API [reference](https://github.com/apache/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts).
If you want to discover the required parameters for a specific chart type, you can inspect existing charts using the GET `/api/v1/chart/{id}` endpoint, which returns the chart's `params` field (the JSON parameters used for that chart) [reference](https://github.com/apache/superset/pull/29573). Alternatively, you can review the frontend plugin code for the relevant viz_type to see how the parameters are structured.
In summary: there is no dynamic API to retrieve a chart parameter schema or template per viz_type; clients are expected to infer the required structure from code or by inspecting existing charts.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/791db04a-aa3e-4c5e-b30b-615e919c2195?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35978)
GitHub link: https://github.com/apache/superset/discussions/35978#discussioncomment-14867190
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Is there an API in Superset to retrieve chart structure for chart creation?
<!-- Answer -->
Superset does not provide an API endpoint that returns a generic chart parameter structure or schema per viz_type for chart creation. The Chart API expects you to construct the payload manually, specifying required fields like `slice_name`, `datasource_id`, `datasource_type`, and optionally `viz_type` and `params` (which is a JSON string containing chart-specific parameters) [reference](https://github.com/apache/superset/discussions/34750) [reference](https://github.com/apache/superset/blob/master/superset/charts/schemas.py).
There is no endpoint that returns a template or schema of required chart parameters per viz_type. The backend schemas (like `ChartPostSchema`) define the general structure for chart creation, but do not provide per-viz_type details [reference](https://github.com/apache/superset/blob/master/superset/charts/schemas.py). The frontend chart plugins define their control panel configuration (parameters, controls, defaults, validation) in static TypeScript files (e.g., `controlPanel.ts`), but this is not exposed via an API [reference](https://github.com/apache/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts).
If you want to discover the required parameters for a specific chart type, you can inspect existing charts using the GET `/api/v1/chart/{id}` endpoint, which returns the chart's `params` field (the JSON parameters used for that chart) [reference](https://github.com/apache/superset/pull/29573). Alternatively, you can review the frontend plugin code for the relevant viz_type to see how the parameters are structured.
In summary: there is no dynamic API to retrieve a chart parameter schema or template per viz_type; clients are expected to infer the required structure from code or by inspecting existing charts.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=791db04a-aa3e-4c5e-b30b-615e919c2195) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/35978#discussioncomment-14867190
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
Posted by "Ruchitha598 (via GitHub)" <gi...@apache.org>.
GitHub user Ruchitha598 added a comment to the discussion: Is there an API in Superset to retrieve chart structure for chart creation?
Thank you for the above response @dosu
Is there is any alternate way to get the chart's params field (the JSON parameters used for that chart) any indirect API
GitHub link: https://github.com/apache/superset/discussions/35978#discussioncomment-14867712
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Is there an API in Superset to retrieve chart structure for chart creation? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Is there an API in Superset to retrieve chart structure for chart creation?
<!-- Answer -->
Yes, you can retrieve the chart's params field (the JSON parameters used for that chart) using a few indirect API methods, but only for existing charts—not as a generic template per viz_type.
- The GET /api/v1/chart/{id_or_uuid} endpoint returns all details for a specific chart, including the params field with the chart's configuration as JSON. This is the most direct way to get the params for any existing chart by its ID or UUID [(source)](https://github.com/apache/superset/pull/29573).
- If you want to get params for all charts on a dashboard, you can use GET /api/v1/dashboard/{id_or_slug}/charts, which returns a list of charts (and their params) for that dashboard [(source)](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
- You can also export dashboards using GET /api/v1/dashboard/export/, which includes all associated charts and their params in the exported YAML files [(source)](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
There is no API that returns a generic or default chart params structure for a given viz_type—these APIs only return params for charts that already exist.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=ff0cc5fe-0434-4e12-a660-a2e0034d81ca) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/35978#discussioncomment-14867728
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org