It’s not the method I use, but this may help you…
https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/554675