Not Found

GitHub REST API · GET /repos/{owner}/{repo}/contents/{path} · HTTP 404

Status: ✅ verified:server:prod · first seen 2026-10-31 · last confirmed 2026-10-31 · 1 confirmation from 1 vantage

An anonymous GET /repos/{owner}/{repo}/contents/{path} for a file path that does not exist returns HTTP 404 with message Not Found and a documentation_url to the get-repository-content docs.

What to do

  1. No client-side fix known (by design).

Example

What probe af:github:probe:contents-not-found sends (prod) and what it checks in the answer.

GET https://api.github.com/repos/octocat/Hello-World/contents/agent-facts-no-such-file

Response (only what the probe asserts; other fields omitted):

HTTP 404

{
  "message": "Not Found",
  "status": "404",
  "documentation_url": "…repos/contents#get-repository-content…"
}

In your code

When an SDK receives this response:

SDK Raises Check
Python PyGithub (community) github.UnknownObjectException e.status == 404
Node @octokit/request RequestError err.status === 404

Read from the SDK source: PyGithub 2.10.0: github/Requester.py Requester.createException; @octokit/request 10.0.16: dist-bundle/index.js fetchWrapper; @octokit/request-error 7.1.2.

Dimensions

env: prod · plan: any · region: any · account_state: anonymous

Evidence

Probe af:github:probe:contents-not-found (declarative, source)

Observations: none from reporters yet.

Related errors

Machine access

Match signature (what check() matches): not found

curl -s https://apifacts.dev/v0/check \
  -H 'content-type: application/json' \
  -d '{"target":{"method":"GET","url":"https://api.github.com/repos/{owner}/{repo}/contents/{path}"},"error":{"status":404,"body_excerpt":"not found"}}'

YAML: facts/github/contents-missing-path-404.yaml


Data: CC BY 4.0 · apifacts registry · This page is generated; edit the YAML, not the page.