ARTIFACTORY: How to add JPD using CURL

AuthorFullName__c
Yonatan Hen
articleNumber
000005730
FirstPublishedDate
2023-05-18T16:09:26Z
lastModifiedDate
2025-07-20

ARTIFACTORY: How to add JPD using CURL

In order to add a new JPD using REST API, we should run a curl command in a specific pattern. As a demonstration:

curl -u<username>:<password> -XPOST -H "Authorization: Bearer <source access token>" -H "Content-Type: application/json" -d '{"name" : "DEV","url" : "<new JPD url>","token" : "<pairing token from JPD instance>","location" : {"city_name" : "Washington, D.C.","country_code" : "US", "latitude" : 38.89511,"longitude" : -77.03637}}' http://<source hostname>/mc/api/v1/jpds


If the JPD is added successfully, the output will be similar to the following:

{"id":"JPD-13","name":"DEV","url":"<new JPD url>","base_url":"<new JPD base url>","location":{"city_name":"Washington, D.C.","country_code":"US","latitude":38.89511,"longitude":-77.03637},"status":{"code":"ONLINE","message":"All services are online","warnings":[]},"local":false,"services":[{"type":"ARTIFACTORY","status":{"code":"ONLINE"}},{"type":"JFMC","status":{"code":"ONLINE"}}],"tags":[],"licenses":[],"is_cold_storage":false,"cold_storage_jpd":"JPD-13"}% 


Make sure you are providing a Pairing Token from the new JPD you are registering, and an Access Token for the authorization header.

Additionally, note that the whole JSON content must be wrapped with a single quote since the JSON parameters are wrapped with double quotes (if you wrap the JSON content in double quotes within the curl command, it would result in an incorrect command syntax, and the curl request would likely fail).

For further information, refer to the Access Tokens, and the Add JPD API documentation.