Appointment as heir apparent
Departing from the established anti-Shia policies of his predecessors, al-Mamun invited al-Rida to Khorasan in 816 CE, and designated him as successor in 817. According to Madelung, al-Mamun wrote to al-Rida in 200 AH (815/816 CE), invited him to come to Merv, and also sent Raja ibn Abi'l Zahhak, cousin of his vizier, and a eunuch to accompany al-Rida on this trip. In the same year, al-Rida might have also made the pilgrimage to Mecca with his five-year-old son Muhammad al-Jawad. After some initial resistance, al-Rida set out for Merv in 816. According to a narration that some ancient sources have confirmed, Ma'mun had ordered that the Imam not be taken via Kufa and Qom, as he was worried that the feelings of the Shias of these cities in their friendship with the Imam would create problems for him (Ma'mun).
Though he did not pass through Qum on his way to Merv, he stayed for some time in Nishapur, where prominent Sunni traditionists visited him, including Ibn Rahuya, Yahya ibn Yahya, Moḥammad ibn Rafe', and Ahmad ibn Ḥarb. Al-Rida continued on to Marv after receiving a new summons from al-Mamun.
A number of Sunni hadith scholars also asked al-Rida to narrate a hadith for them that has become known as the Hadith of Golden Chain.
In Merv, al-Mamun first offered al-Rida the caliphate, though this was turned down by the latter. According to Madelung, al-Rida resisted al-Mamun's proposals for about two months until he reluctantly consented to an appointment as heir to the caliphate. The sources seem to agree that al-Rida was reluctant to accept this nomination, ceding only to the insistence of the caliph, with the condition that he would not interfere in governmental affairs or the appointment or dismissal of government agents. On 2 Ramadan 201 AH (23 March 817) by one account, the dignitaries and army leaders in Merv pledged their allegiance to the new heir apparent, who was dressed in green. An official announcement was made in the mosques throughout the empire, coins were minted to commemorate the occasion, and al-Mamun also changed the color of uniforms, official dress, and flags from black, the official Abbasid color, to green. This move possibly signified the reconciliation between the Abbasids and the Alids. To strengthen their relations, al-Mamun also married his daughter to al-Rida and promised another daughter to al-Rida's son in Medina, a minor at the time.
The motivations of al-Mamun for this appointment are not fully understood. At the time, he justified his decision by maintaining that al-Rida was the most suitable person for the caliphate. The reluctance of al-Rida in accepting this designation, however, might reflect his suspicion that al-Mamun had ulterior motives. With an age gap of more than twenty years, it also seems unlikely that al-Rida would ever have succeeded the much younger al-Mamun. With this appointment, some have suggested that al-Mamun hoped for the support of the Shia and respite from their numerous revolts. Others have suggested that al-Mamun was influenced by his powerful Persian vizier, af-Fadl ibn Sahl, who had Shia tendencies. Madelung, however, finds it more likely that the initiative to appoint al-Rida belonged to al-Mamun and not his vizier. Some authors have not found the appointment surprising, noting the strained or severed relations of the caliph with his Abbasid relatives. Yet others have written that al-Mamun wanted a merit-based caliphate, though he made no mention of rules governing the succession to al-Rida during the ceremony. It has been suggested that al-Mamun might have wanted to heal the Sunni-Shia division, while Lapidus and others hold that al-Mamun wanted to expand his authority by adopting the Shia views about the divine authority of religious leaders, alongside his later religious inquisition (mihna). Bayhom-Daou considers it likely that al-Mamun saw this appointment as a means of discrediting the Shia doctrine of Imamate, and Tabatabai writes that al-Mamun might have also hoped to undermine the position of al-Rida as a Shia religious leader by engaging him in politics.
Al-Rida's rejection of al-Mamun's initial offer for replacing him as the caliph has been used to argue that al-Rida's ultimate aim was not temporal and political power. Rather, Mavani suggests that such power was merely a means for the Imam to reach the ultimate goal of guiding the community to salvation. When al-Rida was asked why he accepted the successorship, he is reported to have emphasized his unwillingness, responding, "The same thing which forced my grandfather the Commander of the Faithful [Ali ibn Abi Talib] to join the arbitration council [i.e., coercion]". To show his dissatisfaction with the trip to Khorasan, as reported by Ibn Babuyyah, al-Rida not only refused to take his family with him but also asked them to cry loudly for him, saying that he would never return to his family's embrace.
It also appears that this appointment did not alienate any of the followers of al-Rida which, according to Bayhom-Daou, might imply that they were convinced that he was a reluctant player who had no choice but to accept his designation as the heir apparent.
Perhaps incorrectly, the appointment of al-Rida was at the time largely attributed to the influence of al-Mamun's Persian vizier, al-Fadl ibn Sahl. Nevertheless, various Abbasid governors, with the exception of Ismail ibn Jafar in Basra, loyally carried out their orders and exacted the oath of allegiance to the new heir. The appointment of the Alid al-Rida by the Abbasid al-Mamun apparently brought him the support of several notable Alids and nearly all the Zaydite partisans. It also immediately invoked strong opposition, particularly among the Abbasids and Arab Sunni nationalists. Al-Mamun's decision did not carry the public opinion of the Iraqis, who declared him deposed and installed Ibrahim ibn al-Mahdi, another Abbasid, as caliph in 817, while the popular militia roamed through Baghdad, demanding a return to the Quran and the Sunna. Ibrahim, a half-brother of al-Mamun's father, is said to have been a weak statesman and a mere figurehead, whose rule was largely confined to Baghdad. There were also military engagements in Baghdad, Kufa, and Wasit between al-Mamun's forces and the supporters of Ibrahim who were themselves much harassed by financial and logistical difficulties.