Currently, this isn't possible via the HubSpot API.
You can associate contacts with deals either through the Deals API or the CRM Associations API, but engagements do not automatically transfer as they do in-app and there is no option to transfer them via API.
If your team is highly technical and has significant development resources, your team could build a solution which effectively scans the associated contacts and creates new engagements on the deals which mirror the contact’s engagements, but this is far from an ideal solution.
Currently, this isn't possible via the HubSpot API.
You can associate contacts with deals either through the Deals API or the CRM Associations API, but engagements do not automatically transfer as they do in-app and there is no option to transfer them via API.
If your team is highly technical and has significant development resources, your team could build a solution which effectively scans the associated contacts and creates new engagements on the deals which mirror the contact’s engagements, but this is far from an ideal solution.