Hadith 649B3

وَالْمُتَطَوِّعُ فِي الْاعْتِكَافِ فِي رَمَضَانَ ، وَالَّذِي عَلَيْهِ الْاعْتِكَافُ أَمْرُهُمَا وَاحِدٌ فِيمَا يَحِلُّ لَهُمَا وَيَحْرُمُ عَلَيْهِمَا وَلَمْ يَبْلُغْنِي ، أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ اعْتِكَافُهُ إِلَّا تَطَوُّعًا
And the condition of voluntary and obligatory i'tikaf is the same; what is permissible in both is permissible, and what is prohibited in both is prohibited. And it has reached me from the Messenger of Allah, peace and blessings be upon him, that his i'tikaf was voluntary.
Hadith Reference موطا امام مالك رواية يحييٰ / كتاب الاعتكاف / 649B3
Hadith Takhrij «شركة الحروف نمبر: 645، فواد عبدالباقي نمبر: 19 - كِتَابُ الِاعْتِكَافِ-ح: 7»