API request within Panel

I have a panel that shows a slider,
I would like that when I click submit, an API request will be generated to create a new panel.
how can i do that?