Skip to content

Instantly share code, notes, and snippets.

hdornier /
Last active Jan 31, 2023
Front API Attachment Example

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 index of the data (ie: {"to": [,]} would be split in two fields named to[0], to[1]).

Below is an example template demonstrating how to send a message via Front's Create conversation API endpoint:

curl -X POST '' \
-H 'Authorization: Bearer YOUR_FRONT_API_TOKEN' \
-H 'Content-Type: multipart/form-data' \
--form 'author_id=AUTHOR_ID' \