If anyone's interested, I just found out that this is the hyperlink destination name property.
So I did this:
hlSource = doc.
paragraphDestinations.add ( destination ); hlSource.name = name
You should check that the destination is duplicated before doing this though
Hyperlinks don't have groups. What looks like a group is simply two or more text sources pointing to the same destination. It's vaguely comparable with what you see in the Links panel when you place two or more pages from the same PDF.