From an interaction with Github Support regarding phantom notifications (ones that I could not mark as read).
Using gh cli.
Running the script to mark notifications as "read" is generally considered safe, as it does not
remove the notification itself, only updates the status of the notification. Here is the script:
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
/notifications \
-F read=true If you have a Personal Access Token (PAT), you can also use the following curl command to mark all of your notifications as read. Please note that in order to use the curl command, you will need to replace $TOKEN with your own PAT, which you can create here. Also note that the PAT must be the "classic" type. A "fine-grained PAT" will not work.
curl -X PUT \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $TOKEN" \
https://api.github.com/notifications