The instrument of Accession of Jammu Kashmir to India was signed by Pandit Jawaharlal Nehru and Maharaja Hari Singh on 26 October 1947. And it was accepted by the Governor-General of India, Lord Mountbatten, on 27 October 1947. Under this, the state surrendered only three subjects (defence, external affairs and communications) to the Dominion of India.
Further Reading :
To read more about Article 370, check the linked article.