# Import Email and attachments

**URL:** <https://community.hubspot.com/t/import-email-and-attachments/18794>\
**Category:** APIs & Integrations\
**Created:** [February 14, 2020, 2:03pm UTC](https://community.hubspot.com/t/import-email-and-attachments/18794 "2020-02-14T14:03:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubsp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hubsp/32/76793_2.png) [@hubsp](https://community.hubspot.com/u/hubsp)\
**Post date:** [February 14, 2020, 2:03pm UTC](https://community.hubspot.com/t/import-email-and-attachments/18794/1 "2020-02-14T14:03:23Z")

</div>

Hi

I’m migrating from superoffice to hubspot and need to import emails with their attachments.

Do I upload the attachments to the “/filemanager/api/v2/files” -endpoint with the “hidden” -property set to “true”. And then take the id from the response and add under attachments when creating email in “Engagement”?

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [February 21, 2020, 3:33pm UTC](https://community.hubspot.com/t/import-email-and-attachments/18794/2 "2020-02-21T15:33:05Z")

</div>

Hey @hubsp

You’re absolutely correct! The steps below is the best solution to achieve this as you have outlined:

1. Upload the desired files to your file manager using the [CMS Files API](https://developers.hubspot.com/docs/methods/files/post_files).
2. When successful, the endpoint above will return a file `id` which you can then use in the next step.
3. Create `EMAIL` engagements on the desired contact, company, or deal record with the file `id` in the `attachments` array.
4. If done successfully, this will create email engagements with files attached to them on any contact, company, or deal record timeline.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![hubsp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/hubsp/32/76793_2.png) [@hubsp](https://community.hubspot.com/u/hubsp)\
**Post date:** [February 25, 2020, 8:51am UTC](https://community.hubspot.com/t/import-email-and-attachments/18794/3 "2020-02-25T08:51:18Z")

</div>

There is something I’m doing wrong when uploading a file. I can’t open any file except from pdf’s and they seems to be corrupted cause I get error when open them.

When clicking all file types except pdf it looks like this.

 ![Capture.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/6/a6debd3fd3bf1402e49232e1d41f9f29ab0d7fe4.png)

![Capture.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/0/e0679ed34b0895b031f0c880c1dd93d4584b21d7.png)

 ![Capture.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/0/20e72506f4eb7be4e5ffb2ee0bf8e255b46befff.png)

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [February 27, 2020, 3:46pm UTC](https://community.hubspot.com/t/import-email-and-attachments/18794/4 "2020-02-27T15:46:48Z")

</div>

Hey @hubsp

I just want to acknowledge your latest query here and can see that my colleague, Wendy is helping out via the thread here: [https://community.hubspot.com/t5/APIs-Integrations/Upload-emails-and-attachments/m-p/321951#M31003](https://community.hubspot.com/t5/APIs-Integrations/Upload-emails-and-attachments/m-p/321951#M31003)
