In this report, we developed a unified and standardized one-pot sequence that converts pyridine derivatives into 1,2-diazepines by inserting a nitrogen atom. This skeletal transformation capitalizes on the in situ generation of 1-aminopyridinium ylides which rearrange under UV light irradiation. Thorough evaluation of the key parameters (wavelength, reaction conditions, activating agent) allowed us the elaborate a simple, mild and user-friendly protocol. The model reaction was extrapolated to more than 30 examples including relevant substrates affording unique 7-membered structures.