---
updatedAt: 2026-05-28T12:50:37.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/artifactory/llms.txt
---

# Delete Repository

Removes a repository configuration together with the whole repository content. Supported by local, remote, virtual and federated repositories.

**Since:** 2.3.0

**Supported JFrog Subscriptions:** Local, remote, and virtual repositories require a Pro subscription. Federated repositories are supported from Artifactory 7.18.3 and require an Enterprise X or Enterprise+ subscription.

**Security:** Requires an admin user.

**Produces:** `application/json` — structured `RemoveRepositorySuccessReport` or `RemoveRepositoryFailureReport`.

**Status codes:**
- **200** — Repository config removed; all artifacts deleted successfully.
- **202** — A delete for this repository is already in progress (deletion lock held). Response uses the success report shape; retry later.
- **207** — Partial artifact deletion — some artifacts failed. Repository config is **not** removed. Delete remaining artifacts and retry.
- **400** — Invalid repo key (blank, trash, or support-bundle repo).
- **403** — Permission denied, validation failure, or **all** artifacts failed to delete.
- **404** — Repository does not exist.
- **409** — Import still in progress, or a Worker vetoed deletion (`BEFORE_REPO_DELETE`).
- **424** — Federated repository could not be removed from remote federation members.
- **500** — Unexpected failure or lock acquisition failure.

`errors` in a failure report is capped at `artifact.delete.report.failure.examples.max` (default **50**); `deleteArtifactsFailureCount` reflects the true total.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JFrog Artifactory Repositories API",
    "description": "REST API for managing repositories in JFrog Artifactory, including local, remote, virtual, and federated repositories.\n\nAdditional repository settings may exist in future product releases; clients should accept unknown JSON properties and tolerate fields not listed in this specification.\n\nAdditional examples of repository configuration are available at:\nhttps://docs.jfrog.com/integrations/docs/configuration-json-files#repository-configuration-json\n",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support"
    }
  },
  "servers": [
    {
      "url": "https://{jfrog_url}/artifactory/api",
      "description": "JFrog Platform",
      "variables": {
        "jfrog_url": {
          "default": "myserver.jfrog.io",
          "description": "Your JFrog Platform hostname (e.g., mycompany.jfrog.io)"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Repositories",
      "description": "Repository management operations"
    }
  ],
  "paths": {
    "/repositories/{repoKey}": {
      "delete": {
        "tags": [
          "Repositories"
        ],
        "summary": "Delete Repository",
        "description": "Removes a repository configuration together with the whole repository content. Supported by local, remote, virtual and federated repositories.\n\n**Since:** 2.3.0\n\n**Supported JFrog Subscriptions:** Local, remote, and virtual repositories require a Pro subscription. Federated repositories are supported from Artifactory 7.18.3 and require an Enterprise X or Enterprise+ subscription.\n\n**Security:** Requires an admin user.\n\n**Produces:** `application/json` — structured `RemoveRepositorySuccessReport` or `RemoveRepositoryFailureReport`.\n\n**Status codes:**\n- **200** — Repository config removed; all artifacts deleted successfully.\n- **202** — A delete for this repository is already in progress (deletion lock held). Response uses the success report shape; retry later.\n- **207** — Partial artifact deletion — some artifacts failed. Repository config is **not** removed. Delete remaining artifacts and retry.\n- **400** — Invalid repo key (blank, trash, or support-bundle repo).\n- **403** — Permission denied, validation failure, or **all** artifacts failed to delete.\n- **404** — Repository does not exist.\n- **409** — Import still in progress, or a Worker vetoed deletion (`BEFORE_REPO_DELETE`).\n- **424** — Federated repository could not be removed from remote federation members.\n- **500** — Unexpected failure or lock acquisition failure.\n\n`errors` in a failure report is capped at `artifact.delete.report.failure.examples.max` (default **50**); `deleteArtifactsFailureCount` reflects the true total.\n",
        "operationId": "deleteRepository",
        "parameters": [
          {
            "$ref": "#/components/parameters/repoKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Repository deleted successfully; all artifacts removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositorySuccessReport"
                },
                "examples": {
                  "success": {
                    "summary": "Repository and content removed",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Repository 'my-local' and all its content have been removed successfully.",
                      "deletedArtifactsCount": 42,
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Deletion already in progress for this repository (lock held). Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositorySuccessReport"
                },
                "examples": {
                  "inProgress": {
                    "summary": "Concurrent delete in progress",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: 'my-local', repository deletion is already in progress",
                      "deletedArtifactsCount": 0,
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Partial artifact deletion — repository config was not removed. Inspect `errors` and retry after deleting remaining artifacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "partialFailure": {
                    "summary": "Some artifacts could not be deleted",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: Aborting deletion of repository: 'my-local' because some artifacts could not be deleted. Delete all artifacts from the repository and try again.",
                      "deletedArtifactsCount": 1,
                      "deleteArtifactsFailureCount": 2,
                      "errors": [
                        {
                          "status": 403,
                          "message": "Undeploy of path: 'my-local/artifact2.txt' was canceled: Protected by: 'undeletable' property"
                        },
                        {
                          "status": 403,
                          "message": "Undeploy of path: 'my-local/artifact3.txt' was canceled: Protected by: 'undeletable' property"
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — invalid repo key (blank, trash, or support-bundle repo).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "invalidRepoKey": {
                    "summary": "Support-bundle or system repository key",
                    "value": {
                      "repoKey": "JFrog-Support-Bundles",
                      "statusMsg": "Cannot delete repository: repository key is blank, trash or support bundle",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bad Credentials — the provided authentication is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "badCredentials": {
                    "summary": "Missing or invalid authentication",
                    "value": {
                      "errors": [
                        {
                          "status": 401,
                          "message": "Authentication is required"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Permission Denied — validation failure, insufficient permissions, or all artifacts failed to delete.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "insufficientPermissions": {
                    "summary": "Non-admin user",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: 'my-local', Reason: User: ('non-admin') has insufficient permission to delete repositories: my-local",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  },
                  "protectedArtifact": {
                    "summary": "Artifact deletion blocked by policy",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: 'my-local'. See error report for more info.",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 1,
                      "errors": [
                        {
                          "status": 403,
                          "message": "Undeploy of path: 'my-local/artifact.txt' was canceled: Protected by: 'undeletable' property"
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found — the specified repository was not found. Response uses the success report shape; rely on HTTP **404** and `statusMsg`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositorySuccessReport"
                },
                "examples": {
                  "repoNotFound": {
                    "summary": "Repository config does not exist",
                    "value": {
                      "repoKey": "missing-repo",
                      "statusMsg": "Cannot delete repository: 'missing-repo', repository config does not exist",
                      "deletedArtifactsCount": 0,
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict — import still in progress, or a Worker vetoed deletion (`BEFORE_REPO_DELETE`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "importInProgress": {
                    "summary": "Repository import still running",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: 'my-local', import is still in progress",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  },
                  "workerVeto": {
                    "summary": "BEFORE_REPO_DELETE worker rejected deletion",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Cannot delete repository: 'my-local', Reason: BEFORE_REPO_DELETE Worker Event Error: blocked by policy",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "424": {
            "description": "Failed Dependency — federated repository could not be removed from remote federation members.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "federationRemovalFailed": {
                    "summary": "Remote federation members update failed",
                    "value": {
                      "repoKey": "fed-maven",
                      "statusMsg": "Federation remote members failure, URLS: [http://peer.example.com/artifactory/fed-maven]",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error — unexpected failure or lock acquisition failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveRepositoryFailureReport"
                },
                "examples": {
                  "lockAcquisitionFailed": {
                    "summary": "Could not acquire repository deletion lock",
                    "value": {
                      "repoKey": "my-local",
                      "statusMsg": "Failed to acquire repository deletion lock: lock interrupted",
                      "deletedArtifactsCount": 0,
                      "deleteArtifactsFailureCount": 0,
                      "errors": [],
                      "success": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    },
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "parameters": {
      "repoKey": {
        "name": "repoKey",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "The repository key"
      }
    },
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-JFrog-Art-Api"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "description": "Standard Artifactory error JSON: HTTP status and message per error entry.\n",
        "type": "object",
        "required": [
          "errors"
        ],
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "status",
                "message"
              ],
              "properties": {
                "status": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        },
        "example": {
          "errors": [
            {
              "status": 404,
              "message": "File not found."
            }
          ]
        }
      },
      "RemoveRepositorySuccessReport": {
        "description": "Successful (or in-progress) single-repository deletion report. Used for HTTP 200, 202, and 404 (repository not found) on Delete Repository. For 404, `success` is `true` in the body; use HTTP status and `statusMsg` for the outcome.\n",
        "type": "object",
        "required": [
          "repoKey",
          "statusMsg",
          "deletedArtifactsCount",
          "success"
        ],
        "properties": {
          "repoKey": {
            "type": "string",
            "description": "Repository key that was targeted for deletion."
          },
          "statusMsg": {
            "type": "string",
            "description": "Human-readable status message."
          },
          "deletedArtifactsCount": {
            "type": "integer",
            "format": "int64",
            "description": "Number of artifacts deleted during this attempt."
          },
          "success": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always `true` for this success report shape (including 202 in-progress)."
          }
        },
        "example": {
          "repoKey": "my-local",
          "statusMsg": "Repository 'my-local' and all its content have been removed successfully.",
          "deletedArtifactsCount": 1,
          "success": true
        }
      },
      "ArtifactDeleteFailure": {
        "description": "Individual artifact deletion failure included in a failure report.",
        "type": "object",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "description": "HTTP status of the individual artifact failure."
          },
          "message": {
            "type": "string",
            "description": "Failure message for the artifact."
          }
        }
      },
      "RemoveRepositoryFailureReport": {
        "description": "Partial or failed single-repository deletion report. Used for HTTP 400 (invalid repo key), 403, 409, 424, 500, and 207 (partial artifact deletion).\nValidation and policy failures use empty `errors[]`; per-artifact failures populate `errors`. `errors` is capped at `artifact.delete.report.failure.examples.max` (default 50); `deleteArtifactsFailureCount` is the true total.\n",
        "type": "object",
        "required": [
          "repoKey",
          "statusMsg",
          "deletedArtifactsCount",
          "deleteArtifactsFailureCount",
          "errors",
          "success"
        ],
        "properties": {
          "repoKey": {
            "type": "string",
            "description": "Repository key that was targeted for deletion."
          },
          "statusMsg": {
            "type": "string",
            "description": "Human-readable status message."
          },
          "deletedArtifactsCount": {
            "type": "integer",
            "format": "int64",
            "description": "Number of artifacts deleted during this attempt."
          },
          "deleteArtifactsFailureCount": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of artifact deletion failures (may exceed `errors` length)."
          },
          "errors": {
            "type": "array",
            "description": "Sample of artifact deletion failures (capped).",
            "items": {
              "$ref": "#/components/schemas/ArtifactDeleteFailure"
            }
          },
          "success": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": "Always `false` for this failure report shape."
          }
        },
        "example": {
          "repoKey": "my-local",
          "statusMsg": "Cannot delete repository: 'my-local'. See error report for more info.",
          "deletedArtifactsCount": 0,
          "deleteArtifactsFailureCount": 1,
          "errors": [
            {
              "status": 403,
              "message": "Undeploy of path: 'my-local/artifact.txt' was canceled: Protected by: 'undeletable' property"
            }
          ],
          "success": false
        }
      }
    }
  }
}
```