# Attaching files via the API

**URL:** <https://community.servicem8.com/t/attaching-files-via-the-api/447>\
**Category:** API & SDK\
**Created:** [December 28, 2023, 11:14pm UTC](https://community.servicem8.com/t/attaching-files-via-the-api/447 "2023-12-28T23:14:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@developer](https://community.servicem8.com/u/developer)\
**Post date:** [December 28, 2023, 11:14pm UTC](https://community.servicem8.com/t/attaching-files-via-the-api/447/1 "2023-12-28T23:14:23Z")

</div>

**Originally posted by Hamish**

In the developer docs ([https://developer.servicem8.com/docs/attaching-files-to-a-job-diary](https://developer.servicem8.com/docs/attaching-files-to-a-job-diary)) for adding attachments to jobs via the API, should the endpoint for submitting the attachment data be POST [https://api.servicem8.com/api\_1.0/Attachment/2404fbd2-cff6-4222-86b4-54a6ea4dbb8b.json](https://api.servicem8.com/api_1.0/Attachment/2404fbd2-cff6-4222-86b4-54a6ea4dbb8b.json) instead of POST [https://api.servicem8.com/api\_1.0/Attachment/2404fbd2-cff6-4222-86b4-54a6ea4dbb8b.file](https://api.servicem8.com/api_1.0/Attachment/2404fbd2-cff6-4222-86b4-54a6ea4dbb8b.file) ? (IE .json instead of .file)

 ![](https://us1.discourse-cdn.com/flex002/uploads/servicem8/original/1X/f3dad3e8d2cd73c84020678ecfc66fdeab9f9ba5.png)

The docs for attaching files indicate it should be .json → [https://developer.servicem8.com/reference/post-attachment-single](https://developer.servicem8.com/reference/post-attachment-single)

 ![](https://us1.discourse-cdn.com/flex002/uploads/servicem8/original/1X/5b30c91ebb7b261fd6697855abd201b003cb85e6.png)

Thanks  
Hamish
