Unable to infer object type from: files

Hi, I’m trying to create an association between a contact and a attached file via API integration using the package GitHub - HubSpot/hubspot-api-php: HubSpot API PHP Client Libraries for V3 version of the API · GitHub but I’m having an error.

The response is the following:

Unable to infer object type from: files

I’ve done a test using directly Insomnina as following:

What I’m doing wrong?

I’ve configured the following permissions for the private app:

Hey @psjavi,

Files are associated to Contacts in the CRM using Engagements (Notes). When creating an engagement you can include the file ID by including it in the “hs_attachment_ids” attribute in your request. Once the engagement has been created you can then associate to the contact using to engagement using type “contact_to_note”.