# Attaching multiple files to a ticket

**URL:** <https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [February 27, 2025, 4:47pm UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041 "2025-02-27T16:47:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JcUnitag](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@JcUnitag](https://community.hubspot.com/u/JcUnitag)\
**Post date:** [February 27, 2025, 4:47pm UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041/1 "2025-02-27T16:47:24Z")

</div>

Hi,

I am trying to attach multiple files to a ticket via API.

I uploaded the files first, got the file ID, created the ticket, and got the ticket ID—everything’s good.

For a single file, everything works well. I made a note with the properties:

`type HSNoteProperties struct { HSNoteBody string `json:"hs\_note\_body,omitempty"`HSAttachmentId string`json:"hs\_attachment\_ids,omitempty"`HSTimestamp string`json:“hs\_timestamp,omitempty”`}`

To the endpoint:

`"https://api.hubapi.com/crm/v3/objects/notes"`

However, this does not work for multiple files. I’ve tried the same endpoint with association

`{ AssociationCategory: "HUBSPOT_DEFINED", AssociationTypeID: 22,}`

but this does not work, telling me the associationTypeID is wrong.

So… How can I attach multiple files to a ticket or a note? I cannot find anything up to date…

Many thanks in advance

---

<div class="post-metadata">

**Author:** ![JcUnitag](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@JcUnitag](https://community.hubspot.com/u/JcUnitag)\
**Post date:** [February 27, 2025, 6:50pm UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041/2 "2025-02-27T18:50:11Z")

</div>

Apologies, I don’t see how to edit my first message. However, I have noticed that there is an “attachment” section in the ticket, different from “notes.” How can I attach uploaded files to a ticket? (Is there a way to attach multiple files at once?). I couldn’t find anything in the documentation.

---

<div class="post-metadata">

**Author:** ![JAli81](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@JAli81](https://community.hubspot.com/u/JAli81)\
**Post date:** [December 2, 2025, 5:11pm UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041/3 "2025-12-02T17:11:04Z")

</div>

Hi @JcUnitag, did you ever manage to find a solution for this? I’m also trying to add an attachment to a ticket.

---

<div class="post-metadata">

**Author:** ![JcUnitag](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@JcUnitag](https://community.hubspot.com/u/JcUnitag)\
**Post date:** [December 3, 2025, 10:08am UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041/4 "2025-12-03T10:08:52Z")

</div>

Hi,

Yes, in our case we create the ticket first with a post request on [https://api.hubapi.com/crm/v3/objects/tickets](https://api.hubapi.com/crm/v3/objects/tickets).

Once the call succeed it’ll return a body with the ID of the ticket. We then have to do two extra steps:  
- We create a note on the endpoint [https://api.hubapi.com/crm/v3/objects/notes](https://api.hubapi.com/crm/v3/objects/notes). One note per file to attach

- each note will return an id and we then attach the note to the ticket:

```lia-code-sample
if withFiles == "true" {
		for _, fileID := range cST.FilesIDs {
			noteID, err := h.createAttachmentNotes(ctx, strconv.Itoa(int(fileID)))
			if err != nil {
				return "", err
			}

			if err = h.attachNoteToTicket(ctx, noteID.ID, idTicket.ID); err != nil {
				return "", err
			}
		}
	}

```

To attach a note to a ticket, we are using the following;

```lia-code-sample
hsNotestoTicket := HSNotesToTicket{
		Inputs: []HSNotesToTicketInput{
			{TicketFrom: IDFromTO{ID: ticketID}, ToNote: IDFromTO{ID: noteID}, Type: "ticket_to_note"},
		},
	}

```

Sent to the endpoint: [https://api.hubapi.com/crm/v3/associations/ticket/note/batch/create](https://api.hubapi.com/crm/v3/associations/ticket/note/batch/create)

It’s not very straightforward, and HubSpot makes changes faster than their doc can catch up, making the whole project really hard.

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [February 28, 2025, 3:29pm UTC](https://community.hubspot.com/t/attaching-multiple-files-to-a-ticket/127041/5 "2025-02-28T15:29:11Z")

</div>

@JcUnitag - although its obscure and perhaps a bit arcane, the approach for multiple files is that the file ID values (internal values) are separated by a semicolon. You will find this works smoothly.

Steve
