/projects/{projectId}/files

List files in the agentic project's shared-data git repository, optionally narrowed to a subtree.

The /files endpoint lists the files tracked in an agentic project's shared-data Git repository. Pass an optional prefix query parameter to narrow the listing to a subtree (for example, knowledge).

Agentic projects only. These endpoints are backed by the project's shared-data Git repository (branch main). Requests against non-agentic projects fail with PROJECT_NOT_AGENTIC.

Learn more at Wren AI - Knowledge.

Example response

Each entry is either a file or a dir; size and last_modified are present for files.

{
  "branch": "main",
  "prefix": "knowledge",
  "files": [
    {
      "name": "a.md",
      "path": "knowledge/a.md",
      "type": "file",
      "size": 12,
      "last_modified": "2026-05-12T00:00:00Z"
    },
    {
      "name": "sql-pairs",
      "path": "knowledge/sql-pairs",
      "type": "dir"
    }
  ]
}