Sahih Muslim, Book 44, Hadith 217 (Muslim 6320)

Al-Bari' b. 'Azib reported:

I heard Allah's Messenger (ﷺ) as saying: Hassan b. Thibit, write satire (against the non-believers) ; Gabriel is with you.