Code

List repository files

List files and directories under a repository path. Use this to explore the repository structure before reading specific files with code.read. Returns file names, types (file or directory), and sizes. Supports pagination via cursor for large directories. Supports GitHub and GitLab repositories (not Bitbucket).

post/api/v2/code/listFiles

Request

  • Base URL
    https://zeropath.com
  • Auth
    API key in header X-ZeroPath-API-Token-Id and API key in header X-ZeroPath-API-Token-Secret

Request body

organizationIdstring

Organization that owns the repository.

repositoryIdstring required

Repository to list files from.

refstring

Branch, tag, or commit SHA to list files from. Omit to use the repository's default branch.

pathstring

Directory path relative to the repository root to list contents of (e.g. "src/services"). Omit or pass empty string to list the repository root.

cursorstring

Opaque pagination cursor returned as nextCursor from a previous response. Pass this to fetch the next page of results.

limitinteger

Maximum number of file/directory entries to return per page. Defaults to 100.

Response

Directory entries

provider'github' | 'gitlab' required

Repository provider that served the request. Only providers with native code-inspection APIs are supported.

repositoryIdstring required
refstring nullable required
pathstring required
hasMoreboolean required
nextCursorstring nullable required

Changes

No recorded changes to this operation across all 1 revision of this API.