The Seven Valleys was written after March 1856, probably around 1857-1858[2] in Baghdad after Baháʼu'lláh had returned from the Sulaymaniyah region in Iraqi Kurdistan where he spent two years anonymously with various Sufi sheikhs using the pseudonym Darvish Muhammad-i-Irani.[3][4] The work was written in response to questions posed by Shaykh Muhyi'd-Din, a judge, who was a follower of the Qádiríyyih Order of Sufism.[5] About the time of writing to Baháʼu'lláh, he quit his job, and spent the rest of his life wandering around Iraqi Kurdistan.[6]