Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AlgorithmAlchemy/719c2fc4b73b591f07edb06b37c5f46c to your computer and use it in GitHub Desktop.

Select an option

Save AlgorithmAlchemy/719c2fc4b73b591f07edb06b37c5f46c to your computer and use it in GitHub Desktop.
force_clear_all_github_inbox.py
import requests
import os
TOKEN = "Your private key"
API_URL = "https://api.github.com"
HEADERS = {
"Authorization": f"token {TOKEN}",
"Accept": "application/vnd.github+json",
}
def force_clear_all():
url = f"{API_URL}/notifications"
r = requests.put(url, headers=HEADERS)
if r.status_code == 205:
print("✅ All notifications marked as read (Inbox cleared).")
else:
print(f"⚠️ Failed: {r.status_code} {r.text}")
if __name__ == "__main__":
force_clear_all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment