  Understanding the structural and magnetic properties in layered hybrid
organic-inorganic metal halide perovskites (HOIPs) is key for their design and
integration in spin-electronic devices. Here, we have conducted a systematic
study on ten compounds to understand the effect of the transition metal
(Cu$^{2+}$, Mn$^{2+}$, Co$^{2+}$), organic spacer (alkyl- and aryl-ammonium)
and perovskite phase (Ruddlesden-Popper and Dion-Jacobson) on the properties of
these materials. Temperature-dependent Raman measurements show that the
crystals' structural phase transitions are triggered by the motional freedom of
the organic cations as well as by the flexibility of the inorganic metal-halide
lattice. In the case of Cu$^{2+}$ HOIPs, an increase of the in-plane anisotropy
and a reduction of the octahedra interlayer distance is found to change the
behavior of the HOIP from that of a 2D ferromagnet to that of a quasi-3D
antiferromagnet. Mn$^{2+}$ HOIPs show inherent antiferromagnetic octahedra
intralayer interactions and a phenomenologically rich magnetism, presenting
spin-canting, spin-flop transitions and metamagnetism controlled by the crystal
anisotropy. Co$^{2+}$ crystals with non-linked tetrahedra show a dominant
paramagnetic behavior irrespective of the organic spacer and the perovskite
phase. This work demonstrates that the chemical flexibility of HOIPs can be
exploited to develop novel layered magnetic materials with tailored magnetic
properties.
