Raja served as Sulayman's chief "kātib" (secretary or scribe) and head of the administration of justice. He is credited by the Mamluk historian Ibn Fadlallah al-Umari for advising Sulayman, while he was governor of Palestine, to select the site of Ramla as the new capital of Islamic Palestine, replacing nearby Lydda (Lod). According to the traditional Muslim historians, Raja played an influential role in securing the succession of Sulayman's paternal cousin, the son of Abd al-Aziz ibn Marwan, Umar II, to the caliphate over expectations in the Umayyad ruling family that one of Sulayman's brothers or sons would accede. In the account of the historian al-Waqidi (d. 823), while Sulayman was on his deathbed at his army camp in Dabiq during the major offensive against the Byzantines in 717, Sulayman's succession became a pressing issue. Abd al-Malik had formally designated al-Walid and Sulayman as his successors, but did not specify anyone beyond them; nonetheless, his intention that the office of the caliphate remain in the hands of his direct descendants was common knowledge in the ruling family. Sulayman's chosen successor, his eldest son Ayyub, had predeceased him and the ill caliph debated potential replacements with Raja.