The Messenger of Allah ﷺ was cupped while he was fasting and in the state of ihram.
حدثنا علي بن محمد قال حدثنا محمد بن فضيل عن يزيد بن أبي زياد عن مقسم
احتجم رسول الله ﷺ وهو صائم محرم
No references are available.
Sourcing, [sahih] Abu Dawud narrated it in the Book of Fasting, chapter on the concession regarding that, hadith no. 2373, from the hadith of Shuba from Yazid with the same wording. Tirmidhi graded it sahih, hadith no. 839. See hadith no. 504 regarding its defect. It has corroborating narrations in Bukhari (hadith nos. 1835, 1836, 5694, and others) and elsewhere with similar wording.