The Prophet (ﷺ) got his head shaved during Hajjat-ul-Wada`.'
Sahih al-Bukhari Book 64, Hadith 432