Add card to dashboard using metabase API


I used browser inspection to obtain the api that performs this function because I am attempting to add a created card to the dashboard. I found that the POST dashboard/:dashboarId/cards API worked well.

Upon using this API, I am now receiving 404 errors. Upon closer inspection of my browser, I discovered that they are using PUT dashboard/:dashboarId/cards and setting id = -1.

for what reason? and which one is going to be successful forever?

I just realized that the POST API was removed in the metabase new version

  • We removed two endpoints for bulk editing dashboard cards: DELETE /api/dashboard/:id/cards POST /api/dashboard/:id/cards
    To create, update, and delete dashboard cards in bulk, use PUT /api/dashboard/:id/cards. More info in our documentation.