How to Clear Notifications from Spam Accounts on GitHub


Recently, I ran into a frustrating issue: the notification bell on GitHub just wouldn’t go away.

After looking into it, I discovered that the notifications were coming from a spam account. To make matters worse, the account had already been deleted. That meant the notifications no longer appeared in my list—so there was no way to clear them.

Since the badge just kept lingering, I contacted GitHub Support. Here’s what they told me:

We’re aware of an issue where notifications don’t disappear. As a temporary workaround, you can mark them as read using either the GitHub CLI or a curl command with a Personal Access Token (PAT). Please give that a try.

They also shared the following commands.

Method 1: Using the GitHub CLI

If you already have the GitHub CLI installed, you can run the following command:

gh api \
 --method PUT \
 -H "Accept: application/vnd.github+json" \
 /notifications \
 -F read=true

The official documentation covers this here:

Method 2: Using curl

Prepare a Personal Access Token (PAT) with the notifications scope, then run the following command:

curl -X PUT \
 -H "Accept: application/vnd.github.v3+json" \
 -H "Authorization: token $TOKEN" \
 https://api.github.com/notifications

This is also described in the official documentation:


The GitHub CLI method is particularly simple, so I recommend starting with that. I had no idea this was possible until GitHub Support pointed it out to me—so I hope this tip saves you the same trouble.

If you ever run into a problem where GitHub notifications won’t disappear, definitely give this a try!