(6) بَابُ كَيْفَ يُكْتَبُ هَذَا مَا صَالَحَ فُلاَنُ بْنُ فُلاَنٍ. وَفُلاَنُ بْنُ فُلاَنٍ وَإِنْ لَمْ يَنْسُبْهُ إِلَى قَبِيلَتِهِ، أَوْ نَسَبِهِ
Narrated Al-Bara bin `Azib:
When Allah's Messenger (ﷺ) concluded a peace treaty with the people of Hudaibiya, `Ali bin Abu Talib wrote the document and he mentioned in it, "Muhammad, Allah's Messenger (ﷺ) ." The pagans said, "Don't write: 'Muhammad, Allah's Messenger (ﷺ)', for if you were an apostle we would not fight with you." Allah's Apostle asked `Ali to rub it out, but `Ali said, "I will not be the person to rub it out." Allah's Messenger (ﷺ) rubbed it out and made peace with them on the condition that the Prophet (ﷺ) and his companions would enter Mecca and stay there for three days, and that they would enter with their weapons in cases.
Reference: Sahih al-Bukhari 2698
In-book reference: Book 53, Hadith 8
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 3, Book 49, Hadith 862