Create Multiple Repositories

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Creates multiple repositories using a batch request. The batch request can contain a mix of different package types and repository types.

Note

For additional details and restrictions, see Create Repository.

Warning

When creating multiple repositories using a batch request, if one of the repository configurations is invalid, the entire batch request will fail.

Since: 7.84.3

Security: Requires an admin user.

Usage: PUT artifactory/api/v2/repositories/batch

Consumes: application/json (application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json), application/json (application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json), application/json (application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json), application/vnd.org.jfrog.artifactory.repositories.FederatedRepositoryConfiguration+json

Sample Request:

curl --location --request PUT 'http://{host}:{port}/artifactory/api/v2/repositories/batch' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
--header 'Cookie: ACCESSTOKEN={token}; REFRESHTOKEN={token}' \
--data '[
  {
    "key": "wproj-dev-docker-local-1",
    "packageType": "docker",
    "description": "",
    "notes": "",
    "includesPattern": "**/*",
    "excludesPattern": "",
    "rclass": "local"
  },
    {
    "key": "wproj-dev-docker-local-2",
    "packageType": "docker",
    "description": "",
    "notes": "",
    "includesPattern": "**/*",
    "excludesPattern": "",
    "rclass": "local"
  }
]'

Sample Response:

Successfully created repository 'wproj-dev-docker-local-1' 

Successfully created repository 'wproj-dev-docker-local-2' 

Status Codes:

Code

Description

201

Repositories created successfully

400

Bad request; batch limit exceeded; mandatory keys not configured

409

Repository key conflict

500

Internal server error