Delete File
DELETE/api/v5/repos/:owner/:repo/contents/:path
Request
Path Parameters
owner stringrequired
Repository space address (organization or individual's address path)
repo stringrequired
Repository path (path)
path stringrequired
The path of the file.
Query Parameters
access_token stringrequired
User authorization code
- application/json
Body
shastringrequired
The Blob SHA of the file
branchstring
Branch name. Defaults to the repository's default branch.
messagestringrequired
commit message
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- 1
Schema
commit object
shastring
author object
namestring
emailstring
datestring
committer object
namestring
emailstring
datestring
messagestring
treestring
parentsstring[]
{
"commit": {
"sha": "string",
"author": {
"name": "string",
"email": "string",
"date": "string"
},
"committer": {
"name": "string",
"email": "string",
"date": "string"
},
"message": "string",
"tree": "string",
"parents": [
"string"
]
}
}
Successful Example
{
"commit": {
"sha": "2a90c33ede2c1eafc5943727fd57129d870ad2e4",
"author": {
"name": "xiaogang",
"email": "1150456356@qq.com",
"date": "2024-11-25T02:11:56.000Z"
},
"committer": {
"name": "xiaogang",
"email": "1150456356@qq.com",
"date": "2024-11-25T02:11:56.000Z"
},
"message": "API delete file",
"tree": "791f24a0da8c8458e40da3243bde183d59773514",
"parents": [
"33e9ee7ccd32835a0fb9f2af99264931c06fbe11"
]
}
}