Deleting a repository requires admin access. If OAuth is used, the
delete_repo scope is required.
DELETE /repos/:owner/:repo
Status: 204 No Content
If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:
Status: 403 Forbidden
{
"message": "Organization members cannot delete repositories.",
"documentation_url": "https://developer.github.com/enterprise/2.19/v3/repos/#delete-a-repository"
}
If a site admin has configured the enterprise appliance to prevent users from deleting organization-owned repositories, a user will get this response:
Status: 403 Forbidden
{
"message": "Users cannot delete repositories on this appliance.",
"documentation_url": "https://developer.github.com/enterprise/2.19/v3/repos/#delete-a-repository"
}