# Create Asset REST API Example

**URL:** <https://forum.mautic.org/t/create-asset-rest-api-example/18373>\
**Category:** Development\
**Created:** [March 1, 2021, 6:36pm UTC](https://forum.mautic.org/t/create-asset-rest-api-example/18373 "2021-03-01T18:36:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nacmonad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nacmonad/32/441_2.png) [@nacmonad](https://forum.mautic.org/u/nacmonad)\
**Post date:** [March 1, 2021, 6:36pm UTC](https://forum.mautic.org/t/create-asset-rest-api-example/18373/1 "2021-03-01T18:36:31Z")

</div>

[https://developer.mautic.org/#create-asset](https://developer.mautic.org/#create-asset)

I’m desperate for an example where user POSTs the file, and the asset is returned.

The docs say the arguments are title/ storageLocation/ file.  
Using postman – I can attach a file, but receive a 400: “File was not found in the asset directory.”.  
I’m trying to upload the file, not reference an existing one 😕

---

<div class="post-metadata">

**Author:** ![mohitp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mohitp/32/543_2.png) [@mohitp](https://forum.mautic.org/u/mohitp)\
**Post date:** [June 22, 2021, 9:50am UTC](https://forum.mautic.org/t/create-asset-rest-api-example/18373/2 "2021-06-22T09:50:59Z")

</div>

Hi @nacmonad,  
I was facing the same issue and found a work around for it.  
You will first need to upload the file in assets or images directory using [files endpoint](https://developer.mautic.org/#create-file).  
Once the file is uploaded you will get the file name in response which you can use in next call for creating new asset using [assets endpoint.](https://developer.mautic.org/#create-asset)
