How do I Automatically Create and Add Questions to Dashboards via Node Script

I've created a Node.js script that programmatically generates tables and dashboards in Metabase. After the dashboard creation, I'd like to automate creating a new question (query) and add it directly to the dashboard.

All the tables will have identical structures (same column definitions), but the data is different in each table.

What's the way to achieve this automation in Metabase?

Hi there,

Check out the POST /api/card endpoint. By including the dashboard_id field you can save it in a dashboard. You can also do it manually in Metabase and take a look at the Network tab in your browser to see what API endpoints it uses, how the payload looks, etc.