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.
@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:
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:
@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.
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.