# Attach file to deal record using API

**URL:** <https://community.hubspot.com/t/attach-file-to-deal-record-using-api/69500>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [November 17, 2022, 7:42pm UTC](https://community.hubspot.com/t/attach-file-to-deal-record-using-api/69500 "2022-11-17T19:42:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [November 22, 2022, 7:46pm UTC](https://community.hubspot.com/t/attach-file-to-deal-record-using-api/69500/2 "2022-11-22T19:46:10Z")

</div>

Hi, @SSharma043 👋 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-1.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/b/fbb95fef9483b34377273acbcb592d70d60a457e.png)

- 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​`

 ![files-3.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/bb6d8004b47be43b2603db8d9c6de4714253afb9.png)

 ![files-4.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/4/04d36f1d30882d08f3dc7458420b6e162c1dd9ba.png)

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

Best,

Jaycee

---

_[View the full topic](https://community.hubspot.com/t/attach-file-to-deal-record-using-api/69500)._
