Skip to content

Instantly share code, notes, and snippets.

@startergo
Created October 4, 2025 14:11
Show Gist options
  • Select an option

  • Save startergo/0bd301afec0acd5c0313d4734b259bd0 to your computer and use it in GitHub Desktop.

Select an option

Save startergo/0bd301afec0acd5c0313d4734b259bd0 to your computer and use it in GitHub Desktop.
Delete unread notification in Github

Get notifications, look for the ID of the spam notification

gh api notification
[
  {
    "id": "19145803528",
    "unread": true,
    "reason": "mention",
    "updated_at": "2025-09-24T00:59:07Z",
    "last_read_at": null,
    "subject": {
      "title": "Y-Combinator W2026 | $15M Y-Combinator & GitHub",
      "url": "https://api.github.com/repos/ycommbbinator/-co/issues/249",
      "latest_comment_url": "https://api.github.com/repos/ycommbbinator/-co/issues/249",
      "type": "Issue"
    },
    "repository": {
      "id": 1062949528,
      "node_id": "R_kgDOP1tSmA",
      "name": "-co",
      "full_name": "ycommbbinator/-co",
      "private": false,
      "owner": {
        "login": "ycommbbinator",
        "id": 233633780,
        "node_id": "U_kgDODez39A",
        "avatar_url": "https://avatars.githubusercontent.com/u/233633780?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/ycommbbinator",
        "html_url": "https://github.com/ycommbbinator",
        "followers_url": "https://api.github.com/users/ycommbbinator/followers",
        "following_url": "https://api.github.com/users/ycommbbinator/following{/other_user}",
        "gists_url": "https://api.github.com/users/ycommbbinator/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/ycommbbinator/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/ycommbbinator/subscriptions",
        "organizations_url": "https://api.github.com/users/ycommbbinator/orgs",
        "repos_url": "https://api.github.com/users/ycommbbinator/repos",
        "events_url": "https://api.github.com/users/ycommbbinator/events{/privacy}",
        "received_events_url": "https://api.github.com/users/ycommbbinator/received_events",
        "type": "User",
        "user_view_type": "public",
        "site_admin": false
      },
      "html_url": "https://github.com/ycommbbinator/-co",
      "description": null,
      "fork": false,
      "url": "https://api.github.com/repos/ycommbbinator/-co",
      "forks_url": "https://api.github.com/repos/ycommbbinator/-co/forks",
      "keys_url": "https://api.github.com/repos/ycommbbinator/-co/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/ycommbbinator/-co/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/ycommbbinator/-co/teams",
      "hooks_url": "https://api.github.com/repos/ycommbbinator/-co/hooks",
      "issue_events_url": "https://api.github.com/repos/ycommbbinator/-co/issues/events{/number}",
      "events_url": "https://api.github.com/repos/ycommbbinator/-co/events",
      "assignees_url": "https://api.github.com/repos/ycommbbinator/-co/assignees{/user}",
      "branches_url": "https://api.github.com/repos/ycommbbinator/-co/branches{/branch}",
      "tags_url": "https://api.github.com/repos/ycommbbinator/-co/tags",
      "blobs_url": "https://api.github.com/repos/ycommbbinator/-co/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/ycommbbinator/-co/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/ycommbbinator/-co/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/ycommbbinator/-co/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/ycommbbinator/-co/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/ycommbbinator/-co/languages",
      "stargazers_url": "https://api.github.com/repos/ycommbbinator/-co/stargazers",
      "contributors_url": "https://api.github.com/repos/ycommbbinator/-co/contributors",
      "subscribers_url": "https://api.github.com/repos/ycommbbinator/-co/subscribers",
      "subscription_url": "https://api.github.com/repos/ycommbbinator/-co/subscription",
      "commits_url": "https://api.github.com/repos/ycommbbinator/-co/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/ycommbbinator/-co/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/ycommbbinator/-co/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/ycommbbinator/-co/issues/comments{/number}",
      "contents_url": "https://api.github.com/repos/ycommbbinator/-co/contents/{+path}",
      "compare_url": "https://api.github.com/repos/ycommbbinator/-co/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/ycommbbinator/-co/merges",
      "archive_url": "https://api.github.com/repos/ycommbbinator/-co/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/ycommbbinator/-co/downloads",
      "issues_url": "https://api.github.com/repos/ycommbbinator/-co/issues{/number}",
      "pulls_url": "https://api.github.com/repos/ycommbbinator/-co/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/ycommbbinator/-co/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/ycommbbinator/-co/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/ycommbbinator/-co/labels{/name}",
      "releases_url": "https://api.github.com/repos/ycommbbinator/-co/releases{/id}",
      "deployments_url": "https://api.github.com/repos/ycommbbinator/-co/deployments"
    },
    "url": "https://api.github.com/notifications/threads/19145803528",
    "subscription_url": "https://api.github.com/notifications/threads/19145803528/subscription"
  }
]

Mark that spam notification as read:

api -X DELETE notifications/threads/19145803528

Confirm that notification is deleted:

gh api notifications                              
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment