How to POST alert rules JSON file through curl?

I have been trying to GET and POST alerts through CURL command. I set the rules initially through the localhost web UI. Following that I was able to get the rules as a JSON file on to my machine using the curl -X GET <url>. But when I try to post, I am not able to do so. How are we supposed to update the JSON and post or maybe POST everytime when we start grafana?

I am new to grafana. Your help is much appreciated here!

welcome to the :grafana: community @aneelakaint

what api endpoint are you trying to POST to? could you share the link to the api documentation that you have checked?