Grafana overwrite existing dashboard via API

Viewed 6306

I'm trying to overwrite existing grafana dashboard via API, like this :

curl -X POST -H "Content-Type: application/json" "https://api_key:xxx/api/dashboards/db" -d @test.json

And i'm facing an issue with versioning, cannot overwrite the same dashboard with my json :

{"message":"The dashboard has been changed by someone else","status":"version-mismatch"}⏎

Is there a way to avoid this and force overwriting ?

Thanks !

2 Answers

Increment version field one time or several.

 "uid": "hDfaY-fGk",
  "version": 20            <-this one. Make it 21, 22, 23
}
Related