How to programatically update dashboard filters?

Hi,
My use case is I migrated multiple cards from table 1 to table 2. I want to update automatically the dashboards linked with those previously updated cards in order to updates the filters’ links.

What I did ?

  • I made a matching between older fields id and new fields id.
  • I got the dashboard info through GET /api/dashboard/ route.
  • I replaced in dashboard info each occurence of older fields id by new fields id, and send it to metabase through POST /api/dashboard/ route.

The bad beahvior :

  • I have 500 dashboards with certains with a lot of complexity It made a lot of unwanted updates in dashboards such removing cards, update description…

The API lacks of documentation on the structure of the response such that it is difficult to spot precisely filters links in dashboards.

Has anyone been on the same use case ? How did you deal with it ? Is there a way to do it easily and programmatically ?

Thank you !