---
title: "Delete file"
method: DELETE
path: "/api/repos/{namespace}/{repo_name}/file/{resource}"
tags: ["Files"]
---

# Delete file

`DELETE /api/repos/{namespace}/{repo_name}/file/{resource}`

## Request

- Base URL: `https://hub.oxen.ai`
- URL: `https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/file/{resource}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oxen/apis/oxen-server/docs/api/repos/:namespace/:repo_name/file/:resource/delete.ts> (a function with typed inputs; its response is checked against the schema)

Remove a file from the repository. Stage the file as removed to a workspace and commit the removal. Can remove files or directories.

## Path parameters

- `namespace` string, required
- `repo_name` string, required
- `resource` string, required

## Request body `multipart/form-data`

- FileUploadBody: Multipart form for uploading files. Use `file` for a single full-path upload, or `files[]` for uploading one or more files into a directory.
  - `email` string, nullable
  - `file` string, binary, nullable: Deprecated: use `files[]` instead.
  - `files` string[], required
  - `message` string, nullable
  - `name` string, nullable

## Response `200`

File removed successfully

- CommitResponse
  - `oxen_version` string, nullable
  - `status` string, required
  - `status_message` string, required
  - `commit` Commit, required
    - `author` string, required
    - `email` string, required
    - `id` string, required
    - `message` string, required
    - `parent_ids` string[], required
    - `timestamp` string, date-time, required

## Other responses

- `404`: Branch or path not found

---

[API](https://skmtc.dev/oxen/apis/oxen-server.md) - [All operations](https://skmtc.dev/oxen/apis/oxen-server/llms.txt) - [OpenAPI document](https://skmtc.dev/oxen/apis/oxen-server/revisions/8021aa6fa5bc?raw)
