Not Found

GitHub REST API · GET /repos/{owner}/{repo}/contents/{dir}/{subdir}/{subdir2}/{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 of a four-segment contents path that does not exist returns HTTP 404 Not Found; a missing parent directory gets the same 404, not a separate error.

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.

Step 1 → HTTP 404:

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

Step 2 → HTTP 404:

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

Step 3 → HTTP 404:

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

Step 4 → HTTP 404:

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

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

HTTP 404

{
  "message": "Not Found"
}

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/{dir}/{subdir}/{subdir2}/{path}"},"error":{"status":404,"body_excerpt":"not found"}}'

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


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