/projects/{projectId}/files/batch

Apply multiple file upsert/delete operations to the shared-data repository as a single atomic commit.

The /files/batch endpoint applies multiple file operations — upsert and delete — to the shared-data repository as a single atomic commit. Use it to bulk-import files or to sync your knowledge/ and mdl/ files from your own source of truth in one request.

Agentic projects only. Every operation's path must be under a writable prefix — knowledge/ or mdl/ — otherwise the request fails with PROJECT_FILES_PATH_NOT_WRITABLE. Requests against non-agentic projects fail with PROJECT_NOT_AGENTIC.

Learn more at Wren AI - Knowledge.

Example response

Returns the resulting commit and the number of operations applied.

{
  "commitSha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
  "operationCount": 2
}