The Prophet ﷺ was cupped while he was in the state of Ihram for Muharram pilgrimage.
أن النبي ﷺ احتجم وهو محرم.
No references are available.
Muslim narrated it in Hajj (1202) through several routes from Sufyan bin Uyayna, from Amr (that is, Ibn Dinar), from Tawus and Ataa, from Ibn Abbas, with this wording.Bukhari narrated it in the Recompense for Game (1835) through the route of Sufyan, who said, Amr said, "The first thing I heard was Ataa saying, 'I heard Ibn Abbas...'" (and he mentioned it). He said, "Then I heard him say, 'Tawus narrated to me, from Ibn Abbas.'" I said, "Perhaps he heard it from both of them."