/projects/{projectId}/files/{path}

Read, create/update, or delete a single file in the shared-data repository.

The /files/{path} endpoint reads, creates or updates, and deletes a single file in the shared-data repository. The {path} segment is the file's path within the repository (for example, knowledge/sql-pairs/foo.md).

  • GET — read a file. Reads are allowed for any path in the repository.
  • PUT — create or update a file. Writes are restricted to the knowledge/ and mdl/ prefixes.
  • DELETE — delete a file under knowledge/ or mdl/.

Agentic projects only. Reads are allowed for any path in the repo; writes are restricted to the knowledge/ and mdl/ prefixes and otherwise fail with PROJECT_FILES_PATH_NOT_WRITABLE. Requests against non-agentic projects fail with PROJECT_NOT_AGENTIC.

Learn more at Wren AI - Knowledge.

Example responses

{
  "path": "knowledge/sql-pairs/foo.md",
  "content": "# Revenue\nRevenue means net revenue.\n",
  "lastModified": "2026-05-12T00:00:00Z"
}
{
  "path": "knowledge/sql-pairs/foo.md",
  "commitSha": "3f9a1c7e2b8d4056a1e9c3f7b2d8e40a6c1f9b3e"
}
{
  "path": "knowledge/sql-pairs/foo.md",
  "commitSha": "7c2e9b4a1d8f6035c9a2e7b1f4d80c3a6e1b9d2f"
}