Add panel with HTTP API

I want to add panel to my dashboard through http api.

I get dashboard by uid and edit the json to add panel. When I make new dashboard with this, its folder changes. Please help me

Are you trying to edit an existing dashboard or create a modified copy of an existing dashboard?

Can you explain this more - what does the folder change to?

Thanks for your interest.

I figured it out. I have to assign folderId into the dashboard data.

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

@jianfengye please refer to How create Dashboard and Panel via API and If i want to add a new pannel to a existed dashboard by http api, can it do? by which api?.