Résumé : The loss of magnetic pressure accompanying the decay of the magnetic field in a magnetar may trigger exothermic electron captures by nuclei in the shallow layers of the outer crust. The threshold density and pressure, as well as the maximum amount of heat that can be possibly released were calculated for different nuclei. The Landau-Rabi quantization of electron motion was taken into account using approximate analytical formulas. Results were obtained using experimental atomic masses and the Q values (included recommended ones) from the 2016 Atomic Mass Evaluation supplemented with the atomic mass model HFB-24 available on the BRUSLIB database.