In recent years terahertz (THz) technology has been an emerging research field with a broad range of applications. THz radiation falls between the infrared and microwave radiation in the electromagnetic spectrum. Most THz sources to date are not related to the spin degree of freedom; however, recent research efforts in spintronics and ferromagnetism demonstrated that the electron spin offers completely new opportunities for the generation of ultrafast photocurrents. For instance, magnetic heterostructures are very easy to pattern and potentially allow to tailor THz emission characteristics by design. Here, we demonstrate that an ultrafast spin-current pulse driven by a femtosecond laser pulse can create THz transients in microstructured magnetic heterostructures due to the inverse spin Hall effect. We compare the THz electric field and the THz spectrum of a control CoFeBPt film with microstructured CoFeBPt wires as well as microstructured CoFeBMgO wires patterned on an extended Pt film. We find that the THz electric field amplitude is proportional to the coverage of the CoFeBPt heterostructure on top of the MgO substrate. Furthermore, we analyze the magnetization direction dependence of the THz transients with respect to the easy axis of the ferromagnetic wire. The presented results are the first steps towards shaping and controlling the THz properties by microstructuring of spintronics-based THz emitters.