Abu Saeed Khudri reported,

The Messenger of Allah ﷺ said, "Do not write anything from me. Whoever has written anything from me other than the Quran, let him erase it. Narrate from me, there is no harm in that. But whoever lies about me," — Hammam said, "I think he said, 'deliberately'" — "let him take his seat in the Fire."

Azami 1162

Sahih

عن أبي سعيد الخدري

أن رسول الله ﷺ قال: لا تكتبوا عني، ومن كتب عني غير القرآن فليمحه، وحدثوا عني ولا حرج، ومن كذب علي- قال همام أحسبه قال: متعمدا- فليتبوأ مقعده من النار.

الأعظمي 1162صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Knowledge
Chapter
Encouragement to seek knowledge
Section
Prohibition of writing anything other than the Quran
Numbering
Jami al-Kamil 1162 (2nd edition)
Azami 1162