Created
September 23, 2025 16:53
-
-
Save AlgorithmAlchemy/719c2fc4b73b591f07edb06b37c5f46c to your computer and use it in GitHub Desktop.
force_clear_all_github_inbox.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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