How can I attach a file to contact via API?


We have have form that triggers a web hook on form submission.
The webhook generates a PDF file with contents from the form and uploads the file to the file manager.

So far so good.

Now I want to attach that file to a user (attaching that file in Hubspots when viewing the user works fine). But I can’t figure out how to attach the file via API. I tried via the Update contacts API but that seem to only update properties and does not seem to handle attachments. I did manage to save the file URL as a property on the user but I would prefer an attachment.

Possible related to this issue: but I fail to see how that would help me get my file attached to the user.

How can I get the file attached to the user?


@Sandberg files get attached to records through engagements. When creating an engagement, you can include the IDs of the files in the file manager in the attachments array in the data. See the example POST JSON here: