Bara bin Azib reported,

The Prophet ﷺ said, "When the believing servant is about to depart from this world and proceed to the next, Allah sends down to him angels from the sky..."Then he continued the hadith in full, as it was reported establishing the punishment of the grave, saying, "His soul is taken out, and they ascend with it until they reach the sky. Permission to enter is sought, and it is opened for him, until he is brought to the seventh sky. Then Allah عز وجل says, 'Record the document of My servant in Illiyyun in the seventh sky, and return him to the earth, for from it I created them, to it I return them, and from it I will bring them out once more.'As for the disbeliever, his soul is brought to the lowest sky, permission to enter is sought, but it is not opened for him."Then he recited, "The gates of the sky will not be opened for them" [Araf 7:40], and he mentioned the rest of the hadith.

Azami 271

Sahih

عن البراء بن عازب

عن النبي ﷺ قال: إن العبد المؤمن إذا كان في انقطاع من الدنيا، وإقبال من الآخرة، أنزل الله إليه ملائكة من السماء…- فساق الحديث كما ساقه بكماله في إثبات عذاب القبر- فيخرج روحه، فيصعدون به حتى ينتهوا به إلى السماء، فيستفتح، فيفتح له، حتى ينتهي به إلى السماء السابعة، فيقول الله عز وجل: اكتبوا كتاب عبدي في عليين في السماء السابعة، وأعيدوه إلى الأرض، فإني منها خلقتهم وفيها أعيدهم ومنها أخرجهم تارة أخرى، وأما الكافر قال: فينتهي به إلى السماء الدنيا، فيستفتحون فلا يفتح له، ثم قرأ {لا تفتح لهم أبواب السماء} [سورة الأعراف: ٤٠]، فذكر الحديث.

الأعظمي 271صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Faith in Allah عز وجل
Section
Affirmation of transcendence for Allah the Exalted
Numbering
Jami al-Kamil 271 (2nd edition)
Azami 271