Sample - GitHub REST API
DELETE/repos/{owner}/{repo}

Delete a repository

Deleting a repository requires admin access.

If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a 403 Forbidden response.

OAuth app tokens and personal access tokens (classic) need the delete_repo scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.

5 status codes
204Response
307Temporary Redirect
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:
messagestringoptional
documentation_urlstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Conflict
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 403 is returned: If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:. A 404 is returned: Resource not found. A 409 is returned: Conflict.