# Move file

```http
POST /projects/{project_reference}/files/{file_path}/move
```

Move a file. Requires project.files.write.

## Parameters

| Name                | In    | Required | Description                                                |
| ------------------- | ----- | -------- | ---------------------------------------------------------- |
| `project_reference` | path  | Yes      | Project slug, UUID, or domain that identifies the project. |
| `file_path`         | path  | Yes      |                                                            |
| `ref`               | query |          |                                                            |
| `branch`            | query |          |                                                            |
| `branch_id`         | query |          |                                                            |

## Request body

| Field                 | Type   | Required | Description                                                                                                                                                       |
| --------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `destination_path`    | string | Yes      | Destination file path. The source receives a deletion version and the destination receives a new file ID derived from its path; immutable history remains.        |
| `expected_version_id` | string |          | Expected source version observed by the caller; a stale version returns 409. The move also fences its captured source version and requires an absent destination. |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | The file at its new path.                                                                                   |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 409    | Conflict                                                                                                    |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
