How to permanently delete sources to avoid data keep growing?

After deleting the sources and then checking the list, it still shows the sources with a status of ‘deleted’. Data keeps growing… how to permanently remove/delete source?

If the file is marked as deleted then it has been deleted and will not be counted as part of your storage. The file may remain in CDN cache for a short period after deletion but you can consider the file deleted and your storage usage will reduce.

Let me rephrase it. When I run: “https://api.shotstack.io/ingest/stage/sources” the output data keeps growing substantially. Deleting the file is not the solution. Data just remains with a different state.

OK, I understand what you mean now - a GET request to /ingest/stage/sources endpoint returns the list of assets that have been uploaded. You have deleted some of these but each asset is still listed, only it’s status is marked as ‘deleted’ and it is not removed from the list.

Right now there is no way to filter the list so it will always include the deleted assets.

Can I ask how you are using this list in your application or development process and what your end goal is?

I noticed my source cleaning code was acting buggy a while back and was too busy to fix it, so I had just turned it off. I think this was the cause. At the end of a project, I had a “cleaning” task that gets all ingest sources, then one-by-one runs through the list and deletes them all.

I too assumed deleting a source would remove it from this list. I basically don’t need any sources to persist between build projects… I saw that you were working on a feature to name ingested assets? I might want named assets to persist, but I’d be treating all other assets as ephemeral.

It would be handy if I didn’t have to clean resources using an imperative approach (maybe this already exists and I don’t know it?). Perhaps an ingest parameter that marks a file’s Time-To-Live would be useful?

I’m guessing thecircleoflifefree has a similar aim.

Thanks for the feedback and use case. We will need to consider a permanent delete feature or a filter of some kind. We noticed that the list is also not sorting correctly by newest first which we will fix soon.

We have launched a feature called renditions that lets you resize and reformat your source footage and each of these can include a custom name. The docs for renditions is here: Creating Renditions from Source Files | Shotstack Documentation.

Right now however if you delete a source file, it also deletes the rendition.

Another feature is that, by default, source files and renditions are also sent to the Serve API for hosting. You can exclude files being sent there or delete individual assets. More details on the Serve API here: Manage Hosted Assets withe the Serve API | Shotstack Documentation