From Sahih Muslim (Hadith 3413):
Jabir b. 'Abdullah and Salama b. al-Akwa' said:There came to us the proclaimer of Allah's Messenger (ﷺ) and said: Allah's Messenger (ﷺ) has granted you permission to benefit yourselves, i. e. to contract temporary marriage with women
Reference: Muslim 3413