> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# deleteRepo()

> Permanently delete a repository and all its contents.

<CodeGroup>
  ```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  // Delete a repository
  const result = await store.deleteRepo({
    id: 'team/project-alpha',
  });

  console.log(result.message);
  // "Repository team/project-alpha deletion initiated. Physical storage cleanup will complete asynchronously."

  // Handle deletion errors
  try {
    await store.deleteRepo({ id: 'non-existent-repo' });
  } catch (error) {
    if (error instanceof ApiError) {
      console.error('Delete failed:', error.message);
      if (error.statusCode === 404) {
        console.log('Repository not found or already deleted');
      } else if (error.statusCode === 403) {
        console.log('Missing repo:write permission');
      }
    }
  }
  ```

  ```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  # Delete a repository
  result = await storage.delete_repo(
      id="team/project-alpha"
  )

  print(result.message)
  # "Repository team/project-alpha deletion initiated. Physical storage cleanup will complete asynchronously."

  # Handle deletion errors
  try:
      await storage.delete_repo(id="non-existent-repo")
  except ApiError as error:
      print(f"Delete failed: {error.message}")
      if error.status_code == 404:
          print("Repository not found or already deleted")
      elif error.status_code == 403:
          print("Missing repo:write permission")
  ```

  ```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  // Delete a repository
  result, err := client.DeleteRepo(context.Background(), storage.DeleteRepoOptions{
  	ID: "team/project-alpha",
  })
  fmt.Println(result.Message)

  _, err = client.DeleteRepo(context.Background(), storage.DeleteRepoOptions{ID: "non-existent-repo"})
  if err != nil {
  	var apiErr *storage.APIError
  	if errors.As(err, &apiErr) {
  		fmt.Printf("Delete failed: %s", apiErr.Message)
  		if apiErr.Status == 404 {
  			fmt.Println("Repository not found or already deleted")
  		} else if apiErr.Status == 403 {
  			fmt.Println("Missing repo:write permission")
  		}
  	} else {
  		fmt.Println(err)
  	}
  }
  ```
</CodeGroup>

## Options

<ParamField path="id" type="string" required>
  Repository ID to delete
</ParamField>

## Response

<ResponseField name="repoId" type="string">
  The ID of the deleted repository
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message about the deletion
</ResponseField>

## Important Notes

* Repository deletion is **permanent and irreversible**
* All branches, commits, and files are permanently removed
