It is narrated from Harmalah (may Allah have mercy on him) that he said: "I asked Sayyiduna Zayd bin Thabit (may Allah be pleased with him) for a ruling about sleeping while sitting, and he saw no harm in it. I said: 'What is the ruling if I put my side down on the ground (that is, lie down and sleep)?' He replied: 'Perform ablution.'"
Imam Abu Abdullah (may Allah have mercy on him) said: "This is a matter of consensus."
It is also narrated (through another chain) from Sayyidah Aishah (may Allah be pleased with her); its text comes in the next narration.