Ways to check if a file is deleted in HubSpot

Currently, when getting data from files API like search, we are not getting deleted/trash files. Is therer any to check that particular file is deleted? Because i’m saving file data to my Database and i want to delete files if deleted from hubspot. Thanks.

Unfortunately, HubSpot does not provide any API to get deleted files.
For now, the best approach is to regularly compare the files in your database with those currently available in HubSpot, marking or deleting records in your database for files that are no longer present in HubSpot (404 in API response)
Ex:
GET https://api.hubapi.com/files/v3/files/{{fileId}}