Creating questions using api


As there is no integrated support within metabase in multi-tenancy (having the same dashboard(s) for different data sources, which are basically the same schema for different customers),
I wanted to utilize the metabase API in order to "duplicate" it automatically.

Per my understanding, I can create a collection, create a dashboard (and connect it to the collection), and then create a set of questions in the new dashboard.
From what I see, the main thing I will need to manipulate is the dataset_query, where I need to modify the IDs of the source-table, fields etc.

However, looking at the API, I couldn't find a way to create a question.
Am I missing something?

Would love some guidance.

Rotem Dafni

The function clone_card in this repo, is probably what you are looking for.

@King_Edward for what i saw in the clone_card function, it only works if its differents tables that are in the same database.

Do you know if there is a way to do it using differents databases?

See this issue.