Can I update existing dashboard using UPDATE api?

Hi,

I am wondering if I can update existing dashboard using UPDATE api with saved json file. I am trying to see if I can revert my old changes back on dashboard back to Kibana. I am designing a way to have version control using provided APIs from elastic (https://www.elastic.co/guide/en/kibana/master/saved-objects-api.html)

Yes, this is why we have those APIs. Just be sure to have backups before doing it, because the JSON approach has very few safeguards to prevent the dashboard from breaking. Also keep in mind that a dashboard is usually composed of multiple visualizations, so you may need to update the dashboard and all of its visualizations and all of its index patterns at the same time. This is possible with the bulk API.

1 Like

Awesome. thanks for the reply. Just one quick question.

I will use UPDATE api, that means it will be something like this:

curl -X PUT api/saved_objects/<dashbaord or visualization>/<id> <some actual json>

is this right? In the example, I only see index.

That would work, but it might be easier to use the dashboard REST API. It lets you import/export the dashboard and everything it depends on: https://www.elastic.co/guide/en/kibana/current/dashboard-api.html

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.