It's one of Imam Mahdi's ayings that have been written down in a letter to his deputies or to some of the leaders which is called Ziyarat al-Nahiya al-Muqaddasa (Ziyarat of the sacred area).The text of Ziarah was recieved by some of Shaykh al-Mufid's masters and then to Shaykh al-Mufid and then Syed Murtadha and Ibn Mashadi by one of Imam Mahdi's special deputie's.

The Ziarah (Pilgrimage) have so many valid sources and it's documents are confirmed by so many of Shia's Ulama (scholars).

Ziyarat al-Nahiya al-Muqaddasa is the Imam Mahdi's threnody and jeremiad and elegy for his grateful (blessed) grandfather Imam Hussein (as) in the Ashura day.

This Ziarat (Pilgrimage) Starts with greetings to to the messengers of God, holy Imams (as) then continued with greetings to Imam Hussein (as) and to his loyal companions and then completely describes the Imam Hussein's lifestyle and biography before his rising in Ashura, and shows that how much Imam Mahdi (as) loves Imam Hussein (as) and describes that what happened in Karbala, and that how Imam Hussein (as) was Martyred and Imam Hussein's sufferings and the mourning and lamentation of whole world and anything that live in the earth and the sky.

And finally It end's with resorting to holy Imam's (as) and praying in the presence of God.

Another Ziarat (Pilgrimage) with this name exists that qouted from Shaik Muhammad ibn Qalib al-Isfihani for Abu Mansur ibn Abdul-Mun'im ibn Na'man Baqdadi that contains the name's of eighty-one of Imam Hussein (a) companionship.

According to this Ziarat (Pilgrimage) entry time is related to Imam Hadi (as) and the document of this Ziarat (Pilgrimage) are in the this books.

Preference:

The Book of Iqbal, Bihar al-Anwar, Awalim, Nāsikh al-tawārikh, al-Dua Wa al-Ziarah, Ramz ul-Musibah, Ansar ul-Hussein