How to associate email with record?

How to associate email with record?

Is there a way in Deluge or with the API to associate an email to a custom module record? I'm using the v2.1 Send Email method so I have the message_id of the email but don't see a way to add that to the Emails section of the custom module record because updateRelatedRecords expects a number while message_id is a string.

The custom module doesn't have a primary or secondary email so I'm using Contact records for the Send Mail call.