ARTIFACTORY: How to remove the "Default Deployment Repository" in the Virtual Repository Settings via API

Products
Frog_Artifactory
Content Type
REST_API
AuthorFullName__c
Yunzong Guo
articleNumber
000006722
FirstPublishedDate
2025-12-25T07:52:41Z
lastModifiedDate
2025-12-25

ARTIFACTORY: How to remove the "Default Deployment Repository" in the Virtual Repository Settings via API

Description 

Artifactory's virtual repository type allows you to set a "Default Deployment Repository", enabling users to upload artifacts via the virtual repository:

User-added image 

In addition to the UI, you can also add or modify a "Default Deployment Repository" via API, such as through the following API:
(Update Repository Configuration: https://jfrog.com/help/r/jfrog-rest-apis/update-repository-configuration)
curl -uadmin:password -X POST http://localhost:8082/artifactory/api/repositories/generic-virtual -H "Content-Type: application/json" -d '{"defaultDeploymentRepo" : "generic-local1"}'

 

Response:
Repository generic-virtual update successfully.

However, if you want to remove the "Default Deployment Repository" via API, you usually don't know how to do it. Setting the "defaultDeploymentRepo" to "null" or removing the "defaultDeploymentRepo" parameter doesn't work.

How to solve this issue? Here is a workaround.


Solution 

You can set the "Default Deployment Repository" to a Non-existent repository name, such as "generic-xxx":
curl -uadmin:password -X POST http://localhost:8082/artifactory/api/repositories/generic-virtual -H "Content-Type: application/json" -d '{"defaultDeploymentRepo" : "generic-xxx"}'
After that, you can see the "Default Deployment Repository" has been removed from the UI:



User-added image 

This might be helpful if you have a lot of virtual repositories that need to be configured via API.