Abdullah bin Amr bin As reported,

I used to write down everything I heard from the Messenger of Allah ﷺ, wanting to memorize it. But Quraysh forbade me, saying, "Do not write down everything you hear from the Messenger of Allah ﷺ. The Messenger of Allah ﷺ is a human being who speaks in anger and in pleasure."So I stopped writing, and I mentioned this to the Messenger of Allah ﷺ. He pointed with his finger to his mouth and said, "Write. By the One in whose hand my soul is, nothing comes out of it except the truth."

Azami 698

Sahih

عن عبد الله بن عمرو بن العاص، قال

كنت أكتب كل شيء أسمعه من رسول الله ﷺ أريد حفظه فنهتني قريش، وقالوا: لا تكتب كل شيء تسمعه من رسول الله ﷺ، ورسول الله ﷺ بشر يتكلم في الغضب والرضا، فأمسكت عن الكتاب فذكرت ذلك لرسول الله ﷺ فأومأ بإصبعه إلى فيه، فقال: اكتب، فوالذي نفسي بيده ما يخرج منه إلا حق.

الأعظمي 698صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the messengers, peace and blessings be upon them
Section
Infallibility of the prophets in what they report from Allah
Numbering
Jami al-Kamil 698 (2nd edition)
Azami 698