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 [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
