Quick tipDeveloperSmart CRM

Attach a file to a record with the API

A file on a record is a note with an attachment.

Subscription
All tiers
Permissions
Files and notes scopes
Time
4 min · Advanced
Last verified

Short answer

HubSpot's developer docs: adding a file to a record creates a note with the file attached. To do it by API, upload to the file manager, copy the file id, then create a note with the file attached and an associations entry for the record.

1. The calls

1. POST /files/v3/files   (upload; keep the returned id)
2. POST /crm/v3/objects/notes
   properties: hs_timestamp, hs_attachment_ids = FILE_ID
   associations: the record's id and the note-to-record association type

The Files API guide has a full request body example.

2. File properties

To store a file in a property instead, see file properties.

3. Related

Associations API.

Sources

New field notes by email

One email when a new article publishes.

Still stuck?

If this did not fix it, the problem is probably specific to your setup. Book a call and we will look at it together.

Book a call with Sam