Hi Sudhakar,
Thanks for reaching out. With regards to your concern about to pass goal details using API, Unfortunately, there is no way to set the goal using the API. You will have to do it manually in the UI. There is an existing feature request for this so I would recommend keeping an eye on our Developer Blog for information on future releases.
Let me know if you have any questions.
Thanks,
Nirmita Patel Google Ads Team