If i want to add a new pannel to a existed dashboard by http api, can it do? by which api?

I want to add a new pannel to a existed dashboard by http api.

but i do not know which api can be used.

Is there anybody know?

Hello @jianfengye, you can add panel to dashboard using Create / Update dashboard API POST /api/dashboards/db . The dashboard in JSON have to contain the complete dashboard model. So your current dashboard model + added panel. You can get the current dashboard model by API using Dashboard HTTP API | Grafana documentation or in UI by Dashboard -> Settings -> JSON Model . And then to the panels array, add your new panel. It is also described here.

!

Here is my request data to add new dashboards, should I insert the all json models within dashboards? I think it’s a little bit verbosty.

{
“dashboard”: {
<insert json model here???>
},
“message”: “Made changes to xyz”,
“overwrite”: false
}