Once the rivet is inplace, i need to be able to pass some 4mm cord through it.
Sounds more like an eyelet.
Does it need to be a rivet? Sounds like the sort of thing you could do with ‘sex bolts’ (as they were termed in my skateboarding days when they were used to attach grab rails and other dayglow plastic niknaks). Similar to chainring bolts – the nut and bolt sleeve inside each other and sit quite flush to the surface.
Whats the actual material you’re fixing these to, and do you need the rivet/grommet/eyelet to actually hold two materials together or are you looking to dress/protect the hole that the cord passes through.
If it was the latter then a couple of ’banjo shelf support sockets’ pressed into either side of your hole would achieve that. Press them through a washer to get the outer diameter you want.