Delete a file

DELETE {{baseUrl}}/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.

Request Body

{"message"=>"<string>", "sha"=>"<string>", "branch"=>"<string>", "committer"=>{"name"=>"<string>", "email"=>"<string>"}, "author"=>{"name"=>"<string>", "email"=>"<string>"}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{&quot;content&quot;:null,&quot;commit&quot;:{&quot;sha&quot;:&quot;7638417db6d59f3c431d3e1f261cc637155684cd&quot;,&quot;node_id&quot;:&quot;MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd&quot;,&quot;author&quot;:{&quot;date&quot;:&quot;2014-11-07T22:01:45Z&quot;,&quot;name&quot;:&quot;Monalisa Octocat&quot;,&quot;email&quot;:&quot;octocat@github.com&quot;},&quot;committer&quot;:{&quot;date&quot;:&quot;2014-11-07T22:01:45Z&quot;,&quot;name&quot;:&quot;Monalisa Octocat&quot;,&quot;email&quot;:&quot;octocat@github.com&quot;},&quot;message&quot;:&quot;my commit message&quot;,&quot;tree&quot;:{&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb&quot;,&quot;sha&quot;:&quot;691272480426f78a0138979dd3ce63b77f706feb&quot;},&quot;parents&quot;:[{&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5&quot;,&quot;sha&quot;:&quot;1acc419d4d6a9ce985db7be48c6349a0475975b5&quot;}],&quot;verification&quot;:{&quot;verified&quot;:false,&quot;reason&quot;:&quot;unsigned&quot;,&quot;signature&quot;:null,&quot;payload&quot;:null}}}