Yes, this requirement can be realized.
Go to your site's documents bar and create a custom column (hidden), then click Exit grid view and add parameters (can be any value) for your custom column.
Next, go to Settings>Library settings>More library settings>All Documents>Filter>OK.
After setting the filter, no one (including yourself) can visually see the file when they open a SharePoint site, but you can still get it by calling the graph API.
https://graph.microsoft.com/v1.0/sites/{site id}/drive/root/children
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.