Skip to main content
GET
/
api
/
v1
/
repos
/
files
List Files
curl --request GET \
  --url https://api.{cluster}.code.storage/api/v1/repos/files \
  --header 'Authorization: Bearer <token>'
{
  "entries": [
    {
      "mode": "100644",
      "path": "src/main.go",
      "type": "blob"
    }
  ],
  "has_more": true,
  "next_cursor": "docs/guide.md",
  "paths": [
    "README.md"
  ],
  "ref": "main"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

ref
string

Optional branch, tag, or commit SHA to list from. When omitted, the repository default branch is used.

path
string

Optional repository-relative subtree to list. Empty means the repository root.

recursive
boolean

When true, include descendants recursively. When false, only direct children are returned.

cursor
string

Pagination cursor returned by a previous list_files response.

limit
integer
default:1000

Maximum number of paths to return. Defaults to 1000.

Required range: 0 <= x <= 5000
ephemeral
boolean

Whether ref should be resolved from the ephemeral namespace.

Response

Tree entries for the resolved revision.

Paginated tree entries in the repository at the resolved revision.

entries
object[]
required

Tree entries for the resolved revision.

has_more
boolean
required

Whether another page of entries is available.

Example:

true

paths
string[]
required

Flat blob-only path list. Mirrors the path of every entry whose type is "blob". Convenience shape for callers that just want file paths; use entries when you need type/mode.

Repository-relative path used to scope the operation.

Example:
["README.md"]
ref
string
required

The resolved reference (branch name or commit SHA) that was used.

Example:

"main"

next_cursor
string

Cursor to resume pagination from. Empty when there are no more results.

Example:

"docs/guide.md"