The Messenger of Allah ﷺ was cupped on the top of his head while in the state of ihram at Lahy Jamal, on the road to Mecca.
أخبرني هلال بن بشر قال حدثنا محمد بن خالد وهو ابن عثمة قال حدثنا سليمان بن بلال قال قال علقمة بن أبي علقمة أنه سمع الأعرج قال سمعت
أن رسول الله ﷺ احتجم وسط رأسه وهو محرم بلحي جمل من طريق مكة
Bukhari narrated it in the Book of the Recompense of Hunting, Chapter on Cupping for the One in the State of Ihram (Muharram), h: 1836, and Muslim, in Hajj, Chapter on the Permissibility of Cupping for the One in the State of Ihram, h: 1203, from the hadith of Sulayman bin Bilal through this chain, and it is in Kubra, h: 3833.