# Delete file

```http
DELETE /projects/{project_reference}/files/{file_path}
```

Delete a file. Requires project.files.write; API keys also need delete scope.

## Parameters

| Name                  | In    | Required | Description                                                                                                                                                      |
| --------------------- | ----- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference`   | path  | Yes      |                                                                                                                                                                  |
| `file_path`           | path  | Yes      | File path whose deletion appends a deletion version in main or the selected branch; immutable history remains. URL-encode this path when supplied in a REST URL. |
| `ref`                 | query |          |                                                                                                                                                                  |
| `branch`              | query |          |                                                                                                                                                                  |
| `branch_id`           | query |          |                                                                                                                                                                  |
| `expected_version_id` | query |          |                                                                                                                                                                  |

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | File deleted.                                  |
| 400    | Bad request                                    |
| 401    | Unauthorized                                   |
| 403    | Forbidden. API keys also require delete scope. |
| 404    | Not found                                      |
| 409    | Conflict                                       |
| 500    | Server error                                   |
