Here’s a step-by-step practical guide to using the JFrog Artifactory 7.x REST API to manage your instance (create repos, users, etc.) using your server and credentials.
🟢 Artifactory 7.x REST API Quickstart
Server: http://65.2.152.172:8082/
Username: admin
Password: password
1️⃣ Authentication
For scripting/API, you can use:
- Basic Auth (
-u admin:password
) - (Best practice) Create an API key or access token from the UI and use that instead of a raw password.
But for quick testing, Basic Auth is fine.
2️⃣ API Endpoint URLs (7.x)
- Main APIs are under:
http://65.2.152.172:8082/artifactory/api/
For access and user/group management:http://65.2.152.172:8082/access/api/
3️⃣ Check Connectivity
curl -u admin:password http://65.2.152.172:8082/artifactory/api/system/ping
Code language: JavaScript (javascript)
Should return OK
4️⃣ Create a Local Repository
Example: Create a new local Maven repo named my-maven-local
curl -u admin:password -X PUT \
-H "Content-Type: application/json" \
-d '{
"rclass": "local",
"packageType": "maven",
"description": "My Maven local repo"
}' \
http://65.2.152.172:8082/artifactory/api/repositories/my-maven-local
Code language: PHP (php)
- For npm, change
"packageType": "npm"
, etc.
5️⃣ Create a Remote Repository
Example: Create a remote Maven Central proxy
curl -u admin:password -X PUT \
-H "Content-Type: application/json" \
-d '{
"rclass": "remote",
"packageType": "maven",
"url": "https://repo.maven.apache.org/maven2",
"description": "Remote Maven Central"
}' \
http://65.2.152.172:8082/artifactory/api/repositories/maven-central-remote
Code language: PHP (php)
6️⃣ Create a User
curl -u admin:password \
-H "Content-Type: application/json" \
-X PUT "http://65.2.152.172:8082/artifactory/api/security/users/jane" \
-d '{
"email": "jane@example.com",
"password": "JanePassword123!",
"admin": false,
"groups": []
}'
curl -u admin:password -X PUT \
-H "Content-Type: application/json" \
-d '{
"email" : "jane1@example.com",
"password" : "JanePassword123!",
"admin" : false,
"profileUpdatable": true
}' \
"http://65.2.152.172:8082/artifactory/api/security/users/jane1"
Code language: PHP (php)
- Set
"admin": true
if you want to make the user admin.
7️⃣ List Repositories
curl -u admin:password http://65.2.152.172:8082/artifactory/api/repositories
Code language: JavaScript (javascript)
List of Users
curl -u admin:password "http://65.2.152.172:8082/artifactory/api/security/users"
Code language: JavaScript (javascript)
8️⃣ Get Repository Configuration
curl -u admin:password http://65.2.152.172:8082/artifactory/api/repositories/my-maven-local
Code language: JavaScript (javascript)
9️⃣ Delete a Repository
curl -u admin:password -X DELETE http://65.2.152.172:8082/artifactory/api/repositories/my-maven-local
Code language: JavaScript (javascript)
🔟 Create a Group
curl -u admin:password \
-H "Content-Type: application/json" \
-X PUT \
-d '{
"description": "Developers"
}' \
"http://65.2.152.172:8082/artifactory/api/security/groups/developers1"
Code language: PHP (php)
1️⃣1️⃣ Assign a User to a Group
curl -u admin:password -X PATCH \
-H "Content-Type: application/json" \
-d '{
"groups": ["developers"]
}' \
http://65.2.152.172:8082/access/api/v1/users/raj
Code language: PHP (php)
📚 Official Docs & Swagger
- Artifactory REST API Reference (7.x)
- Access (Security) API Reference
- [Interactive Swagger UI (if enabled):**
http://65.2.152.172:8082/artifactory/swagger-ui.html
http://65.2.152.172:8082/access/swagger-ui.html
🚦 Tips
- Use
-v
with curl to debug requests. - Use JFrog CLI for easier scripting and more advanced automation.
- For production, use access tokens or API keys (never passwords).
🟢 Summary Table
Action | API Endpoint Example |
---|---|
Ping | /artifactory/api/system/ping |
Create Local Repo | /artifactory/api/repositories/<repo> |
Create Remote Repo | /artifactory/api/repositories/<repo> |
Create User | /access/api/v1/users/<username> |
Create Group | /access/api/v1/groups/<group> |
Assign User/Group | /access/api/v1/users/<username> (PATCH groups) |
List Repos | /artifactory/api/repositories |
Here are several practical examples for uploading artifacts to Artifactory using different methods, including REST API (with curl) and JFrog CLI. These examples will help you quickly upload files from a local system to an Artifactory repository.
1. Upload with REST API and curl
Syntax:
textcurl -u <USERNAME>:<PASSWORD> -X PUT -T <LOCAL_FILE_PATH> "http://<ARTIFACTORY_URL>/artifactory/<REPO>/<PATH>/<FILENAME>"
Example:
textcurl -u admin:password -X PUT -T ./myapp-1.0.0.jar "http://65.2.152.172:8082/artifactory/my-local-repo/myapp/1.0.0/myapp-1.0.0.jar"
- Replace
my-local-repo
,myapp/1.0.0/
, and the filenames as needed. - You can also include artifact properties in the URL: text
curl -u admin:password -X PUT -T ./app.zip "http://65.2.152.172:8082/artifactory/my-local-repo/app.zip;release=true;version=1.0"
- On success, you’ll see a HTTP
201
response12.
2. Upload Using JFrog CLI
- Install the CLI:
Download here and configure it for your server (one-time setup): textjfrog config add my-server --url=http://65.2.152.172:8082 --user=admin --password=password
- Upload a Single File: text
jfrog rt upload "myapp-1.0.0.jar" "my-local-repo/myapp/1.0.0/"
- Upload All Files in a Folder: text
jfrog rt upload "dist/*" "my-local-repo/myapp/1.0.0/"
- Recursively upload a folder: text
jfrog rt upload "my-folder/*" my-local-repo/
- For advanced usage and options, see the official [JFrog CLI documentation]34.
3. Uploading via Artifactory UI (for small/manual uploads)
- In the Artifactory web UI, navigate to your target repository and folder.
- Click the “Deploy” or “Upload” button.
- Select your file(s) and confirm upload.
4. Upload via CI Tool or Script (Generic)
If automating in CI, your steps would typically use either the REST API (curl, see above), or invoke the JFrog CLI as part of the pipeline.
References for Official Docs and Further Reading:
- Deploy Artifact with REST API
- How to Upload a Folder (with its content) to Artifactory
- JFrog CLI upload documentation1342
Tip:
For scripted automation, always prefer access tokens or API keys over basic passwords for improved security.
If you need specific examples for Maven, npm, or other build types, just specify the ecosystem!
Five different ways to upload JAR files to JFrog Artifactory – YouTube
To interact with your JFrog Artifactory server (http://65.2.152.172:8082/
) using the API (for example, to create repositories, users, etc.), you will mainly use REST API calls authenticated as your admin user. Here’s a clear, practical guide:
1. Authentication
For most API calls, you can use Basic Authentication with your username and password (admin/password), or (recommended) generate and use an access token.
- Basic Auth (not recommended for production scripts):
Use the-u
option withcurl
: textcurl -u admin:password http://65.2.152.172:8082/artifactory/api/system/ping
A response ofOK
means the API is accessible. - Access Token (recommended):
- Log in as admin to the UI.
- Go to Identity and Access → Access Tokens and generate a new admin token.
- Use that token in an API call: text
curl -H "Authorization: Bearer <YOUR_TOKEN>" http://65.2.152.172:8082/artifactory/api/system/ping
2. API Base URL
The API base for your instance is:http://65.2.152.172:8082/
Most API endpoints relevant to Artifactory are under /artifactory/api/
User and group APIs are often under /access/api/
(for Access-based security).
3. Create a Local Repository
REST endpoint:PUT /artifactory/api/repositories/{repoKey}
Example (create a Maven local repository):
textcurl -u admin:password \
-H "Content-Type: application/json" \
-X PUT "http://65.2.152.172:8082/artifactory/api/repositories/my-maven-local" \
-d '{
"rclass": "local",
"packageType": "maven",
"description": "My Maven repo"
}'
- Change
my-maven-local
and"packageType"
as needed (npm, docker, etc.). - For more options (remote/virtual/federated), see the official docs45.
Response:201 Created
on success.
4. Create a User
REST endpoint:POST /access/api/v2/users
Example:
textcurl -u admin:password \
-H "Content-Type: application/json" \
-X POST "http://65.2.152.172:8082/access/api/v2/users" \
-d '{
"username": "jane",
"password": "JanePassword123!",
"email": "jane@example.com",
"admin": false,
"groups": [],
"profile_updatable": true
}'
- Adjust parameters as needed for new user (admin privileges, group membership, etc.).
Requires admin privileges to use this endpoint6.
5. Other Useful API Examples
- Get All Repositories: text
curl -u admin:password http://65.2.152.172:8082/artifactory/api/repositories
- Delete a Repository: text
curl -u admin:password -X DELETE http://65.2.152.172:8082/artifactory/api/repositories/my-maven-local
- List Users: text
curl -u admin:password http://65.2.152.172:8082/access/api/v2/users
6. Best Practices
- Avoid using admin:password in scripts—use access tokens where possible.
- Use appropriate Content-Type headers, usually
application/json
. - For all API calls, check the official Artifactory REST API docs for parameters, endpoint changes, and security notes.
- For complex JSON payloads (like advanced repo settings), you can export config examples from the UI and modify as needed.
7. References for Official API Docs
In Summary:
You can script any Artifactory action—repo creation, user management, build upload, and more—using basic curl
REST requests, authenticated with user/password or an access token. Always follow best practices for authentication and automation.416
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND