# Error with creating Asset

**URL:** <https://forums.screenly.io/t/error-with-creating-asset/6473>\
**Category:** Anthias\
**Created:** [July 8, 2025, 2:51pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473 "2025-07-08T14:51:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicky](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nicky](https://forums.screenly.io/u/Nicky)\
**Post date:** [July 8, 2025, 2:51pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/1 "2025-07-08T14:51:01Z")

</div>

Hello everyone. I faced with error, when I created asset.  
I post request on api/v2/file\_asset to get uri, after what I try to make asset with many diferrent jsons like that  
{  
“name”: “videop4”,  
“uri”: “/data/screenly\_assets/8101e0c685455929ab31b0eb669ec821.tmp”,  
“start\_date”: “2026-08-24T14:15:22Z”,  
“end\_date”: “2026-08-24T14:15:22Z”,  
“duration”: 1,  
“mimetype”: “video/mp4”,  
“is\_enabled”: false  
}, but everytime get this

{  
“error”: “Invalid file path. Failed to add asset.”  
}

there is an interesting situation with the “uri” field: if I change the first part, in particular “/” or remove “data”, an error appears:  
{  
“error”: “Invalid URL. Failed to add asset.”  
}  
But if I change some last part, somehow break it, then the error remains the same.

I would be very grateful for the help.

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [July 8, 2025, 5:06pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/2 "2025-07-08T17:06:40Z")

</div>

@Nicky, removing the `/` or even `/data` will certainly give you issues saying that the file path is invalid. Calling `POST /api/v2/file_asset` will give you a **response** similar to the following:

```json
{
	"uri": "/data/screenly_assets/[random-hex].tmp",
	"ext": ".mp4"
}

```

Make sure not to tamper with the `uri`, as uploaded files get saved in `/data`, and later renamed when `POST /api/v2/assets` succeeds. Your **request** should look similar to the following:

```json
{
  "ext": ".mp4",
  "name": "[preferred-filename].mp4",
  "uri": "/data/screenly_assets/[random-hex].tmp",
  "start_date": "2025-01-03T09:57:48.753Z",
  "end_date": "2026-01-03T09:57:48.753Z",
  "duration": 20,
  "mimetype": "video",
  "is_enabled": true,
  "is_processing": true,
  "nocache": false,
  "play_order": 0,
  "skip_asset_check": true
}

```

_ **TL;DR:** _ Do not modify the path/URI whenever possible.

I hope that answers the question. Please let me know if you need further help.

---

<div class="post-metadata">

**Author:** ![Nicky](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nicky](https://forums.screenly.io/u/Nicky)\
**Post date:** [July 8, 2025, 5:44pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/3 "2025-07-08T17:44:51Z")

</div>

@nicomiguelino , thanks for your help! But I still can’t post it 😄

So, I created a file and get this uri: _/data/screenly\_assets/8101e0c685455929ab31b0eb669ec821.tmp_

And as you told, formed this request:  
{  
“ext”: “.MP4”,  
“name”: “myfirstVideo.mp4”,  
“uri”: “/data/screenly\_assets/8101e0c685455929ab31b0eb669ec821.tmp”,  
“start\_date”: “2025-01-03T09:57:48.753Z”,  
“end\_date”: “2026-01-03T09:57:48.753Z”,  
“duration”: 10,  
“mimetype”: “video”,  
“is\_enabled”: true,  
“is\_processing”: true,  
“nocache”: false,  
“play\_order”: 0,  
“skip\_asset\_check”: true  
}

And still get this error 500:  
{  
“error”: “Invalid file path. Failed to add asset.”  
}

Maybe, I’ve made some mistake again?

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [July 8, 2025, 6:20pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/4 "2025-07-08T18:20:17Z")

</div>

@Nicky, I initially tested the endpoints with images. Clearly, handling of video assets is quite different. I’m still trying to make the API calls work. I’ll let you know when I come up with something.

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [July 8, 2025, 6:43pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/5 "2025-07-08T18:43:39Z")

</div>

@Nicky,

Here’s an update. (I hope it works.) ✨

I revisited the source code and found out that the `POST /api/v2/assets` will likely give an error if `duration` is set to a non-zero value when creating video assets.

In the meantime, what you could do is do an API call to `POST /api/v2/assets` but use `0` for the `duration`.

That behavior is affecting the API user/developer experience. Thanks for bringing this up. I’ll let you know when I made minor and patch changes to that endpoint.

Please let me know if you’re still having the issue.

---

<div class="post-metadata">

**Author:** ![Nicky](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nicky](https://forums.screenly.io/u/Nicky)\
**Post date:** [July 8, 2025, 7:07pm UTC](https://forums.screenly.io/t/error-with-creating-asset/6473/6 "2025-07-08T19:07:29Z")

</div>

@nicomiguelino , thank you very mach!
