Skip to content

[Feature]: API endpoint to delete all repositories in an organization #36512

@karthikbhandary2

Description

@karthikbhandary2

Feature Description

I would like to propose adding a new API endpoint that allows deleting all repositories within an
organization in a single operation.

Proposed API Endpoint:
DELETE /api/v1/orgs/{org}/repos

Use Case:
This endpoint would be useful for:
• Bulk cleanup operations when decommissioning an organization
• Testing environments where you need to quickly reset all repositories
• Administrative tasks that require removing all repositories at once

Expected Behavior:
• Delete all repositories owned by the specified organization
• Require appropriate permissions (organization owner or admin)
• Return a summary of deleted repositories or error details
• Should respect any repository protection rules or policies

API Response Format:

{
  "deleted_count": 5,
  "deleted_repositories": [
    "repo1",
    "repo2", 
    "repo3",
    "repo4",
    "repo5"
  ],
  "errors": []
}

Implementation Location:
This would fit naturally in /routers/api/v1/org/ alongside other organization management
endpoints.

Screenshots

No response

Metadata

Metadata

Labels

topic/apiConcerns mainly the APItype/proposalThe new feature has not been accepted yet but needs to be discussed first.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions