DELETE /repos/{owner}/{repo}/contents/{path}
Deletes a file in a repository.
You can provide an additional committer
parameter, which is an object containing information about the committer. Or, you can provide an author
parameter, which is an object containing information about the author.
The author
section is optional and is filled in with the committer
information if omitted. If the committer
information is omitted, the authenticated user's information is used.
You must provide values for both name
and email
, whether you choose to use author
or committer
. Otherwise, you'll receive a 422
status code.
[!NOTE] If you use this endpoint and the "Create or update file contents" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.
Servers
- https://api.github.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
repo |
String | Yes |
The name of the repository without the |
owner |
String | Yes |
The account owner of the repository. The name is not case sensitive. |
path |
String | Yes |
path parameter |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
sha |
String | Yes |
The blob SHA of the file being deleted. |
committer |
Object | No |
object containing information about the committer. |
committer.name |
String | No |
The name of the author (or committer) of the commit |
committer.email |
String | No |
The email of the author (or committer) of the commit |
message |
String | Yes |
The commit message. |
branch |
String | No |
The branch name. Default: the repository’s default branch |
author |
Object | No |
object containing information about the author. |
author.name |
String | No |
The name of the author (or committer) of the commit |
author.email |
String | No |
The email of the author (or committer) of the commit |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.