Correct way to add attachment to a ticket

Correct way to add attachment to a ticket

I do not forward emails to Desk, but I have a middleware processing specific mailboxes and adding these tickets through the Create Ticket API.

I am not sure what the correct way is to create the attachments. I see you have attachment linked to tickets, but there are also attachments in the thread of the ticket.

When you use the forward email strategy and a person is sending an email with attachments, these are listed in the thread.

But how do you do this through the API? I want to create a ticket + place the attachments of the mail together with the ticket(thread).