Use cURL Integration With Artifactory
Planned for deprecation
jf rt curlis planned for deprecation. Usejf apiinstead, which covers all JFrog Platform APIs (Access, Artifactory, AppTrust, OneModel, and others), reuses your configured server credentials, and does not require acurlbinary on yourPATH.
The jf rt curl command runs cURL against Artifactory using the server and credentials you already configured in the JFrog CLI, so you do not pass URLs or authentication headers manually. You need the curl executable on your PATH. Use this page to prepare your environment, understand options, and follow copy-pastable examples for common REST requests.
Command syntax
jf rt curl <api-path> [--server-id=<server-id>]Where:
<api-path>β Artifactory REST path only (no host), for example/api/system/pingor/api/build.- After the path, pass the same flags you would pass to
curl(method, headers, body, and so on), except the full Artifactory URL and login credentials (the CLI adds those). <server-id>β Optional. Configured server ID fromjf config add. If--server-idis omitted, the default configured server is used.
Example:
jf rt curl /api/system/pingPrerequisites
To prepare for using jf rt curl:
- JFrog CLI is installed β verify with
jf --version - curl is in your PATH β verify with
curl --version - At least one Artifactory server is configured β run
jf config addto add a server, thenjf config showto confirm. For more information, see Configuring the CLI.
Note
This command supports only Artifactory REST APIs, which are accessible under
https://<JFrog base URL>/artifactory/api/.
Note
jf rt curlalways returns exit code0, regardless of the HTTP response status. A401,403, or5xxresponse still produces a zero exit code. To detect failures in scripts, parse the JSON response body or use-w '%{http_code}'to inspect the HTTP status code.
Note
By default, curl prints a progress meter to stdout alongside the response body. Add the
-s(silent) flag to suppress it, for examplejf rt curl -s -XGET /api/system/ping.
Command Parameters
The following table lists the command name and abbreviation.
| Parameter | Command and description |
|---|---|
| Command name | rt curl |
| Abbreviation | rt cl |
Command Options
The following table describes the command option.
| Option | Description |
|---|---|
--server-id | [Optional] Server ID configured using the jf config add command. If not specified, the default configured server is used. |
Environment Variables
The following table describes the related environment variable.
| Variable | Description |
|---|---|
JFROG_CLI_SERVER_ID | [Optional] Server ID to use as an alternative to --server-id. The --server-id flag takes priority if both are set. |
Command Arguments
The following table describes command arguments.
| Argument | Description |
|---|---|
| cURL arguments and flags | The same list of arguments and flags passed to cURL, except for the following changes. You should not pass the full Artifactory URL. Send the REST endpoint URI instead. You should not pass login credentials. Use --server-id instead. |
Supported cURL Options
The following table lists commonly used cURL flags.
| Option | Description | Example |
|---|---|---|
-X | HTTP method (non-GET) | -X POST, -X PUT, -X DELETE. Omit for GET requests (curl infers GET by default). |
-H | Add HTTP header | -H "Content-Type: application/json" |
-d | Send request data/body | -d '{"key":"value"}' |
-v | Verbose output | Shows detailed request/response |
-s | Silent mode | Suppress progress meter |
-o | Output to file | -o response.json |
-i | Include headers | Include response headers in output |
Authentication
To authenticate jf rt curl requests:
Servers can be configured with any of the following authentication methods:
- Username and Password
- Access Token
- API Key
To verify which authentication method is configured for a server, run jf config show.
If you receive a Token failed verification error, your access token may have expired. To update credentials, re-run jf config add with the same server ID, or generate a new token in the JFrog Platform UI under User Management > Access Tokens.
cURL Integration Examples
Example 1: Send a GET Request to the Default Server
To send a GET request to the /api/build endpoint on the default server:
- Run:
jf rt curl /api/build- Inspect the JSON response (see the following expected output).
Expected response:
{
"builds": [...]
}Example 2: Send a GET Request to a Specific Server
To send a GET request to /api/build on a specific configured server:
- Run:
jf rt curl /api/build --server-id my-rt-server- Inspect the JSON response.
Expected response:
{
"builds": [...]
}Example 3: Create a Repository with PUT
To create a new local repository with PUT /api/repositories/<repo-key>:
- Run (replace
my-repowith your repository key):
jf rt curl -XPUT -H "Content-Type: application/json" \
-d '{"key":"my-repo","rclass":"local","packageType":"generic"}' \
/api/repositories/my-repo- Confirm the success message in the output.
To update an existing repository's configuration, use POST /api/repositories/<repo-key> instead of PUT.
Expected response:
Successfully created repository 'my-repo'
Example 4: Ping the Artifactory Server
To verify that the Artifactory REST API responds:
Note
jf rt curlalways injects your stored credentials. If your credentials are expired or invalid, this endpoint returns401, which indicates an authentication failure, not a connectivity problem. To perform a pure connectivity check without authentication, usejf rt pinginstead.
- Run:
jf rt curl -s /api/system/ping- Confirm the response body is
OK.
The -s flag suppresses the curl progress meter so the response body appears cleanly. Without -s, the progress meter is printed to stdout and the OK response is concatenated onto its last line, which breaks output parsing.
Expected response:
OK
Example 5: Return System Version
To return Artifactory version information:
- Run:
jf rt curl /api/system/version- Parse or read the returned JSON.
Expected response:
{
"version": "7.x.x",
"revision": "...",
"addons": [...],
"license": "..."
}Note
The actual response may include additional fields such as
servicesVersionsandentitlements, depending on your Artifactory version and configuration.
Example 6: Use Verbose Mode for Debugging
To run a request with verbose cURL output (for debugging):
Warning
Verbose mode prints your full Bearer token in plaintext in the
authorization:request header line. Do not share terminal output, screenshots, or continuous integration (CI) logs captured with-v. Doing so exposes your live access token. If you have already shared verbose output, revoke and rotate the token immediately in the JFrog Platform UI under User Management > Access Tokens.
Note
When you use
-vwith GET requests, omit-XGETbecause curl infers GET as the default method. Explicitly passing-XGETcauses curl to print"Note: Unnecessary use of -X or --request, GET is already inferred."
- Run:
jf rt curl -v /api/system/version- Review the verbose trace (do not share logs that include the
authorizationheader).
Expected output includes:
* Connected to <your-instance>.jfrog.io port 443
* using HTTP/2
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [authorization: Bearer eyJ... (full token printed here)]
< HTTP/2 200
{"version":"7.x.x","revision":"...","addons":[...],"license":"..."}
Note
The
authorizationheader format depends on how your server was configured:Bearer <token>for access token authentication, orBasic <base64>for username and password. If you configured the server with--basic-auth-only, you will seeBasicin that output.
Example 7: Delete a Repository
To delete a repository with the REST API:
Warning
This operation permanently deletes the repository and all of its contents. It cannot be undone. Only run this against a test or temporary repository.
Note
The repository must already exist. You can create a test repository using Example 3 (replace
my-repowithmy-temp-repoin that example), or substitute an existing repository key formy-temp-repo.
- Run (use a disposable repository key):
jf rt curl -XDELETE /api/repositories/my-temp-repo- Confirm the deletion message in the output.
Expected response:
Repository 'my-temp-repo' and all its content have been removed successfully.
Example 8: Use Environment Variable for Server Selection
To select the server with JFROG_CLI_SERVER_ID instead of --server-id:
- Set the variable and run the request:
export JFROG_CLI_SERVER_ID=my-rt-server
jf rt curl /api/build- Inspect the JSON response.
Expected response:
{
"builds": [...]
}Example 9: Reload Plugins
To reload Artifactory plugins (administrator, self-managed only):
Note
Plugin management through the REST API is only available for self-managed Artifactory installations. This endpoint is not available on JFrog SaaS. On SaaS instances, the server returns HTTP
403with"Function is not supported when running on the cloud". The CLI still exits with code0in both cases.
- Run:
jf rt curl -XPOST /api/plugins/reload- Confirm the success message on self-managed instances.
Expected response (self-managed only):
Plugins have been successfully reloaded.
Example 10: Upload a File with PUT
To upload a local file using PUT and -d @:
- Run (replace paths and repository with your values):
jf rt curl -XPUT -d @/path/to/local/file.txt /my-repo/path/to/file.txt- Confirm HTTP
201and the JSON summary in the output.
Note
The repository
my-repomust exist. See Example 3 to create it.
Expected response (HTTP 201):
{
"repo": "my-repo",
"path": "/path/to/file.txt",
"created": "...",
"createdBy": "<username>",
"downloadUri": "https://<your-instance>.jfrog.io/artifactory/my-repo/path/to/file.txt",
"mimeType": "text/plain",
"size": "<bytes>",
"checksums": {
"sha1": "...",
"md5": "...",
"sha256": "..."
},
"originalChecksums": {
"sha256": "..."
},
"uri": "https://<your-instance>.jfrog.io/artifactory/my-repo/path/to/file.txt"
}Common Errors
To diagnose a failed jf rt curl request, match your symptom to this table.
The following table lists common errors, causes, and resolutions.
| Error | Cause | Resolution |
|---|---|---|
{"status":401,"message":"Token failed verification: parse"} | Access token is expired or malformed | Re-run jf config add to update credentials, or generate a new token in the JFrog Platform UI. |
{"status":403,...} | Authenticated but insufficient permissions | Use an administrator token, or request the required permissions from your Artifactory administrator. |
{"status":404,...} | Repository or path does not exist | Verify the repository key and path, and create the repository first if needed (see Example 3). |
{"status":403,"message":"Function is not supported when running on the cloud"} on /api/plugins/reload | Endpoint not available on JFrog SaaS | This feature is self-managed only. See Example 9. |
| Progress meter printed before response body | curl default behavior | Add -s to suppress, for example jf rt curl -s -XGET /api/system/ping. |
Note: Unnecessary use of -X or --request | -XGET is redundant because curl infers GET by default | Drop -XGET for GET requests. Use -X only for POST, PUT, or DELETE. |
