His grandfather, al-Qasim al-Rassi, was one of the chief authorities of the Zaydi school of Shi'a Islam, and was honoured as "Star of the Family of the Prophet of God" (Najm Āl Rasūl Allāh) and "Interpreter of the Faith" (Turjumān al-Dīn).
[10] In Zaydi doctrine, the imam has to be a "Fatimid", i.e. a descendant of Muhammad's daughter Fatimah and her sons, al-Hasan and al-Husayn,[11] but the position is not hereditary or by appointment (naṣṣ), unlike in the Twelver and Isma'ili traditions of Shi'a Islam.
Zaydi doctrine emphasized that the imamate was not contingent on popular acclaim or election; the very act of daʿwa denotes God's choice.
[5] Like all Shi'a imams, Yahya was opposed to the Abbasid Caliphate, but was also well aware of the failure of all past attempts by Shi'a candidates to stage a successful military uprising against the Abbasids, most notably the uprising of Muhammad al-Nafs al-Zakiyya in 762, the revolt of al-Husayn ibn Ali al-Abid in 786, and a number of failed Zaydi risings in the early 9th century.
[14] These failures had obliged his grandfather to abstain from proclaiming his daʿwa in public, even though his claim to the imamate had been recognized by various communities from the Hejaz, Iraq and Persia, who had sent him pledges of allegiance.
[14] Between 884 and 889, Yahya and his family visited Tabaristan, then ruled by Muhammad ibn Zayd, a brother of the founder of the Zaydi state there.
A khurūj by Yahya would inevitably be a challenge to Muhammad to relinquish his authority, and the latter's expected refusal would lead to an armed clash between the supporters of the two rivals.
[15] In 893/4, Yahya for the first time journeyed to the Yemen, on the invitation of the powerful Banu Futaym clan, living in the northern region of Sa'dah, in order to settle their disputes.
Caliphal authority had traditionally been weak and mostly limited to the capital, Sana'a, while in the rest of the country tribal conflicts, sometimes dating to pre-Islamic times, persisted.
After capturing Sana'a in 861, their rule extended from Sa'dah in the north to al-Janad [ar] (northeast of Taiz) in the south and Hadramawt in the east.
[19] A rival dynasty, the Ziyadids, also nominally loyal to the Abbasids, held Zabid on the western coastal plain, and at times exercised significant control over wide portions of the interior of the country.
[20] The Banu Manakh family ruled the southern highlands around Taiz, while the northern parts of the country were in practice dominated by warring tribes owing allegiance to no-one.
He reached al-Sharafah, some distance from Sana'a, but was then forced to turn back due to indiscipline among his own men, and returned to al-Fara, southwest of Medina.
[15] A new opportunity offered itself three years later, when the same tribal leaders invited Yahya to come back and end the strife-torn conditions of northern Yemen.
[26][27] With the exception of al-Hadi's domain around Sa'ada in the north, Ziyadid-ruled Zabid on the western coast, and Aden in the south, almost all of Yemen was now under Isma'ili control.
[15] This occupation also did not last long, as he quarreled with As'ad ibn Abi Yu'fir, and left the city in November of the same year, allowing the Isma'ilis to recapture Sana'a.
[15] Al-Hadi's rule over northern Yemen was also constantly challenged by tribal rebellions, especially by the Banu'l-Harith tribe of Najran, who in 908 overthrew and killed their Zaydi governor.
[15] In 910, al-Hadi exploited Ibn al-Fadl's absence on campaign to the western coastal plain to once more occupy Sana'a on 7 April, but was forced to abandon it again on 23 June.
The imam had to rely on tribal support, but also did his best to Command the Right and Forbid the Wrong (al-amr bi'l-nar'uf wa-'l nahy 'an al-munkar), and to administer Islamic justice and law.