How upload files using webhooks of a application?

I am trying to create an application and I need it to, in addition to creating a card when responding to the webhook, also previously generate or upload a file to the client’s account. Is this possible? I’m using this documentation as a guide: Accounts Dashboard | HubSpot
Thanks

If you need to upload a file you will need to use the Files API - you could connect this to an incoming webhook.

For example: say you create a HubSpot app with a webhook that listens to changes on a deal stage. You will receive a response when the deal stage is changed. Then you can use the File API to create a new file, this will provide you a file ID, then use the Engagements API to create a Note Engagement with the file ID in the `hs_attachment_ids` property.

Hope this helps!