Imran bin Husayn reported,

I came to the Messenger of Allah ﷺ (and he mentioned the hadith), in which he said, They asked, "We have come to you to ask you about this matter."He replied, "Allah عز وجل existed and there was nothing besides Him. His Throne was upon the water. He wrote everything in the Record, and He created the heavens and the earth."

Azami 1010

Sahih

عن عمران بن حصين، قال

دخلت على رسول الله ﷺ (فذكر الحديث) وقال فيه: قالوا: إنا جئناك نسألك عن هذا الأمر؟ قال: كان الله عز وجل ولم يكن شيء غيره، وكان عرشه على الماء، وكتب في الذكر كل شيء، وخلق السماوات والأرض.

الأعظمي 1010صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
Writing the measures of creation before the creation of the heavens and the earth
Numbering
Jami al-Kamil 1010 (2nd edition)
Azami 1010