---
updatedAt: 2025-02-27T10:38:40.000Z
agentTools:
  projectIndex: https://dev.frontapp.com/llms.txt
---

# Attachments

> 📘
>
> This topic primarily focuses on downloading attachments from the API. For information about sending attachments in API requests, refer to the [Attachments](https://dev.frontapp.com/docs/attachments-1) topic in our Core API guides.

When a message has attached files, the `attachments` array will contain the information needed to retrieve those files.

If the attachment is inline (ie: an image in the body of an email), the property `metadata.cid` will help you retrieve the HTML tag corresponding to the attachmens in the body of the message.

## Download Attachment

In the attachment object, the property url can be used to download the attached file.\
Just like any other API endpoint, the download request should be authenticated.
The response however will not be a JSON object but the content of the file with the correct headers so that you can save it.

> 📘 API rate limit
>
> Downloading attachments will count against your API rate limiting.

Even though all the API is designed to work with JSON, some endpoints support file upload:

* [Create outbound conversation](https://dev.frontapp.com/reference-link/post_channels-channel-id-messages)
* [Reply to Conversation](https://dev.frontapp.com/reference-link/post_conversations-conversation-id-messages)
* [Receive custom messages](https://dev.frontapp.com/reference-link/post_channels-channel-id-incoming-messages)
* [Import message](https://dev.frontapp.com/reference-link/import-inbox-message)
* [Create contact](https://dev.frontapp.com/reference-link/post_contacts)
* [Update a contact](https://dev.frontapp.com/reference-link/patch_contacts-contact-id)
* [Create draft conversation](https://dev.frontapp.com/reference-link/post_channels-channel-id-drafts)
* [Create draft reply](https://dev.frontapp.com/reference-link/post_conversations-conversation-id-drafts)

## Send Multipart Request

> 📘 Set the header appropriately
>
> When you want to send files through the API, your request needs to be sent using the `Content-Type HTTP` header set to `multipart/form-data`.

The JSON data you would normally send in the request body needs to be split in multiple form fields (one for each property) named after the property key. If the property is an array, the name should include the suffix `[]`.

For example `{"to": [email1@example.com, email1@example.com]}` would be split in two fields both named `to[]`.

Restriction on files (type and size) depends on the endpoint. If your request doesn't comply to those limitations, the response will contain an error describing the issue.

You can read more about attachments on the [Attachments](https://dev.frontapp.com/docs/attachments-1) page in our Core API guides.