Replace question in dashboard using the API

Hi, I would like to replace a question in a dashboard by another one to clean Metabase questions that are duplicated without having to do it manually and set all the filters.

I'm using a get request to obtain the information about the card (ordered_cards --> card ) and replace it by the new question information.
I can't find ordered_cards after a put request. Is it due to the fact that it ordered_cards can't be modified ?
Is there another way to replace a question in a dashboard by an existing one

Hi @dancourt
Everything you can do in the interface can be done via the API, since that's how Metabase functions.
The best way to learn the API, is to just use Metabase while having your browser developer Network-tab open and looking at the request, and what data is being send/received.

@flamber Thanks for your quick response.
The problem is thqt we are not able to do it in the interface (we would have to remove the question, add a new one and set all the filters). That's why it would be great to replace a question in a dashboard by changing some dashboard information like ordered_cards.
Any idea ?

@dancourt I don't understand what you are trying to do, but it sounds like we are preventing that, since it would otherwise cause ways of circumventing security.
You might be able to do something directly in the application database. But making manual changes there would be on your own, and could cause corruption.

We have the Enterprise version so we are not self hosted.
I underestand that we can't replace a question by another one in one step via the API.
But is it possible to change a question with the API in three steps : delete a question, add a new question to replace the old one , and update filters automatically ?

@dancourt Filters will not automatically update, but you can remove card and add a new card and update the filters - just like you would do if you did it in the GUI, so you can look at the requests to see what is being sent/received.
There is not a way to replace a single card by itself - there's no such API endpoint.