Panel Linking using HTTP API

Hi. I am trying to create a dashboard using API. One of the panels contains a panel link that changes a templating variable in the same dashboard based on some data in that panel.

The panel link requires my grafana URL, dashboard id, dashboard name, and the parameters that I wish to change.

If I am creating a new dashboard, how am I supposed to pass the dashboard id, since I have to set it to NULL. Without id I cant use my panel links. I want to update the same dashboard using the panel link. Kindly help in this regard.