> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# repos_delete_file

> Delete a file in a commit of its own. Needs the file's blob `sha`, so read it first. To remove several files in one commit, use `git_trees_create` with `delete: true` entries instead.

<div className="tool-route"><span className="tool-row-method" data-method="DELETE">DELETE</span><code>{"https://api.github.com/repos/{owner}/{repo}/contents/{path}"}</code></div>

```python github_repos_delete_file.py theme={null}
from charter.packs import github

result = await github.repos_delete_file.ainvoke({"owner": ..., "repo": ..., "path": ..., "message": ..., "sha": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                         | Type     | Description                                                                              |
  | ------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span> | `string` | The account owner of the repository. The name is not case sensitive.                     |
  | `repo` <span className="required" title="required">\*</span>  | `string` | The name of the repository without the `.git` extension. The name is not case sensitive. |
  | `path` <span className="required" title="required">\*</span>  | `string` | Path to the file, relative to the repository root.                                       |
</div>

## Body

<div className="reference-table">
  | Field                                                           | Type                                                                 | Description                                               |
  | --------------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------- |
  | `message` <span className="required" title="required">\*</span> | `string`                                                             | The commit message.                                       |
  | `sha` <span className="required" title="required">\*</span>     | `string`                                                             | The blob SHA of the file being deleted.                   |
  | `branch`                                                        | `string`                                                             | The branch name. Absent, the repository's default branch. |
  | `committer`                                                     | [CommitIdentity](/charter/charter/packs/github/repos/objects#commitidentity) | Who made the commit. Absent, the authenticated user.      |
  | `author`                                                        | [CommitIdentity](/charter/charter/packs/github/repos/objects#commitidentity) | Who wrote the change, if not the committer.               |
</div>
