# Commit complete canonical file index

```http
POST /projects/{project_reference}/branches/{branchName}/files/{filePath}/index
```

Atomically replace the complete chunk and embedding set for the expected current canonical knowledge version. Requires project.files.write.

## Parameters

| Name                | In   | Required | Description |
| ------------------- | ---- | -------- | ----------- |
| `project_reference` | path | Yes      |             |
| `branchName`        | path | Yes      |             |
| `filePath`          | path | Yes      |             |

## Request body

| Field                 | Type   | Required | Description |
| --------------------- | ------ | -------- | ----------- |
| `expected_version_id` | string | Yes      |             |
| `chunks`              | array  | Yes      |             |
| `model`               | object | Yes      |             |

## Responses

| Status | Description            |
| ------ | ---------------------- |
| 200    | Durable complete index |
| 400    | Bad request            |
| 401    | Unauthorized           |
| 403    | Forbidden              |
| 404    | Not found              |
| 409    | Conflict               |
| 413    | Payload too large      |
| 500    | Server error           |
