List Files With Metadata returns the full file tree for a repository along with per-file commit information in a single request. Each file entry includes its path, mode, size, and the SHA of the most recent commit that touched it. Commit author, date, and message are returned in a deduplicated map keyed by SHA, so large repos with many files sharing a commit do not repeat data.
This is useful for building directory browsers, audit dashboards, or any tool that needs to reason about when files last changed without walking commits manually.
curl -X GET \
-H "Authorization: Bearer $REPO_READ_TOKEN" \
"https://code.storage/api/v1/repos/files/metadata?ref=main"{
"files": [
{
"path": "README.md",
"mode": "100644",
"size": 2048,
"last_commit_sha": "a1b2c3d4e5f6"
},
{
"path": "src/index.ts",
"mode": "100644",
"size": 512,
"last_commit_sha": "a1b2c3d4e5f6"
}
],
"commits": {
"a1b2c3d4e5f6": {
"author": "Jon Crosby",
"date": "2026-02-18T10:30:00Z",
"message": "add list files with metadata endpoint"
}
},
"ref": "main"
}Pass a branch name, tag, or commit SHA as ref. If you omit it, the response resolves against the
repository's default branch.