Attach file to deal record using API

Hi, @SSharma043 :waving_hand: Were you able to get this one sorted out? If not, I’ll share a quick example using Postman.

Summary:

  • Upload the file
  • Create the Note
  • Associate the File to the Note
  • Associate the Note to the Object

Steps

  • Upload your file via API and note the value for “id”

  • Files added can be associated to an Object as a Note

  • Use the 'id” vale as the value for “hs_attachment_ids” when creating a note
    POST https://api.hubapi.com/crm/v3/objects/notes​

  • Then you can make a call to associate the Note to a Deal
    PUT https://api.hubspot.com/crm/v3/objects/notes/{note_ID}/associations/deal/{deal_ID}/214​

I hope this helps you or the next person who is looking to upload and associate files to objects in this manner.

Best,

Jaycee