# Upsert branch file chunks

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

Upsert branch file chunks. Requires project.knowledge.write.

## Parameters

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

## Request body

| Field    | Type  | Required | Description                                                |
| -------- | ----- | -------- | ---------------------------------------------------------- |
| `chunks` | array | Yes      | Chunks to replace the current indexed chunks for the file. |

## Responses

| Status | Description  |
| ------ | ------------ |
| 200    | Result.      |
| 400    | Bad request  |
| 401    | Unauthorized |
| 403    | Forbidden    |
| 404    | Not found    |
| 500    | Server error |
