GitHub API returns 404 error when fetching issues from private repository

I’m having trouble retrieving bug reports from my private GitHub repository through the REST API. Even though I generated a personal access token and gave it full repository access permissions, I keep getting a 404 Not Found response.

Here’s the curl command I’m using to get the issues:

wget --header="Authorization: Bearer {my-token}" https://api.github.com/repos/{username}/{repository-name}/issues

The API keeps returning this error message:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/issues#list-repository-issues"
}

I double checked that the repository name and my username are correct. The token has repo scope enabled. What could be causing this authentication issue? Has anyone else run into similar problems when trying to access private repo data via GitHub’s API?

same issue here! also check if the repo is under your personal account, not an org. refreshing your token could help too. by the way, curl might be better than wget for this kind of stuff, sometimes wget messes up the headers.

404s usually mean scope mismatch or GitHub’s API isn’t recognizing your token. I’ve hit this wall tons of times with automated workflows.

Skip the curl headache and automate the whole thing. Set up a workflow that connects to GitHub’s API, handles auth automatically, and pulls issue data without manual token juggling.

I do this for monitoring bugs across multiple private repos. The automation deals with token refresh, header formatting, and processes responses. Run it on schedule or whenever you need fresh data.

Way more reliable than manual API calls and you won’t debug auth issues every time GitHub tweaks something. Easy to extend for filtering specific issues or syncing data elsewhere.

Check out https://latenode.com for proper setup.

Had this exact problem last month with private repos. Your token isn’t being passed right in the header. Use token instead of Bearer in your authorization header. Should be Authorization: token {your-token} not Authorization: Bearer {your-token}. GitHub’s docs say both work, but I’ve found older tokens sometimes break with the Bearer format. Also check if your token expired - they auto-expire now unless you set them to never expire when creating them.