[8] Pope Honorius III put him in charge of the papal penitentiary and, about 1227, appointed him an auditor of the Roman Rota.
[9] In January 1232, James was named papal legate in northern Italy alongside Otto of Tonengo with the purpose of negotiating a reconciliation between Frederick II, Holy Roman Emperor, and the cities of the Lombard League.
Frederick, who was holding an imperial diet in Ravenna at the time, refused to meet the cardinals and conceived a strong dislike for James.
[5] In 1235, James was sent as a legate to Tuscany, where he arranged a peaceful settlement between the warring cities of Florence, Orvieto and Siena.
[6] He was replacing the legate Alberto da Rezzato and his brief was to block the holding of an imperial diet at Piacenza.
[13] During his stay in native city, James arranged the election of a Cistercian named Egidio to the curacy of the church of Sant'Antonino.
[14] In May 1238, the pope suspended the Inquisition in the lands of Count Raymond VII of Toulouse and nominated James as his legate to lift the latter's excommunication and secure his participation in the planned crusade against Frederick II.
[17] In November, he left on his mission to France to obtain the support of Count Raymond VII and King Louis IX for the crusade against Frederick II.
In October 1239 or 1240, he wrote from Nice to Archbishop Pere d'Albalat [ca] detailing Frederick's crimes.
[19] He was still in France in early 1241, when Gregory IX called for a council to meet in Rome at Easter to pass judgement on the emperor.
In response, James convoked a council at Meaux, at which he urged the French bishops to accompany him to Rome.
Joined by Otto of Tonengo, James and the bishops sailed from Genoa on 25 April in order to avoid Frederick's troops in central Italy.
Otto reportedly received better treatment than James, perhaps because he was seen as more valuable in negotiations, but probably because Frederick harboured ill-will against him from his two previous legations in Lombardy.
[22] Finally, through the intervention of the Emperor Baldwin II of Constantinople, James was released in May 1243 just in time to take part in the May–June 1243 papal election.
[4] The new pope, Innocent IV, immediately appointed James for a second term as vicarius urbis and left Rome for France.