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."
أن رسول الله ﷺ قال: لا تكتبوا عني، ومن كتب عني غير القرآن فليمحه، وحدثوا عني ولا حرج، ومن كذب علي- قال همام أحسبه قال: متعمدا- فليتبوأ مقعده من النار.
Muslim narrated it in Zuhd wal-Raqaiq (3004) from Haddab bin Khalid Azdi, who said, Hammam narrated to us, from Zayd bin Aslam, from Ata bin Yasar, from Abu Saeed, and he related the hadith.Tirmidhi narrated it (2665) through Zayd bin Aslam, in brief, with the wording, "We asked the Prophet ﷺ for permission to write down knowledge, but he did not permit us."