Skip to content

API Reference

CloudRepo has two HTTP interfaces: your repository host, which your build tools use for package protocols, and the management API, which the admin portal uses. This page explains what each one accepts today and where the old per-endpoint API reference pages went.

Used on this page only, never saved. Never enter a token or password here.

Your repository host, your-org.mycloudrepo.io, serves each of your repositories under its own path:

https://your-org.mycloudrepo.io/repositories/your-repo/

You do not make HTTP requests by hand for packages. Your package manager handles that using the protocol for your repository’s format.

Format Your tool speaks Pages
Maven and Gradle The Maven repository layout over HTTP: a file is read and written at its layout path. Publish Maven artifacts, Pull Maven artifacts, Publish Gradle artifacts, Pull Gradle dependencies
npm The npm registry protocol. Publish npm packages, Pull npm packages, npm repositories
Python The PyPI simple index for installs, and an upload for twine. Publish Python packages, Pull Python packages, Python repositories
Docker The Docker Registry HTTP API V2. Push Docker images, Pull Docker images, Docker repositories

Each request to a private repository carries a repository token. The username is the email address of the account that created the token and the password is the token; npm sends the token alone.

A repository with Public Access turned on can be read without credentials. See Repository Management for what Public Access covers.

Your credential also opens a browsing page: GET /repositories/ on your repository host lists, as a web page, the repositories your credential may read.

When a request is refused, the response says why. Error codes lists the codes, and Troubleshooting walks from a status to a fix.

The admin portal runs on the CloudRepo management API at https://api.cloudrepo.io, a different host from your repository host. It creates repositories, adds users, mints tokens and does the rest of what the portal does.

When you create a repository, add a user or create a repository token in the portal, the portal calls the management API with the session of a signed-in person, sent in the Authorization header. Each of those three calls, made without one, is answered 401. The portal holds that session after you sign in. A repository token is a different credential, made for your repository host.

This reference covers the repository operations of the management API (list, create, get and delete a repository), its repository settings operations (get a repository’s settings, turn Overwrite Protection on, set Snapshot Cleanup and turn Public Access off), its group repository operations (create a group repository, list its members, add a member, remove a member and set a member’s priority) and its webhook operations: list webhooks, get a webhook and delete a webhook. The repository settings operations read and change what the Public Access, Overwrite Protection and Snapshot Cleanup cards show on a repository’s Settings page in the admin portal. A group repository is one repository your build tools read from. A Maven group asks its Hosted members first, in the priority you set. A Proxy member serves a file only when no Hosted member you can read holds it. A public registry’s copy never replaces a file a Hosted member holds. A Docker group does the same for a tag, and a PyPI group for a package name. A webhook posts the upload, download and delete events of one repository to its target, as JSON or as a Slack message. Download the OpenAPI file (OpenAPI 3.1) to read it in your API tool or to generate a client from it.

A webhook’s target can be a secret. A Slack target is the incoming-webhook URL Slack gives you, and anyone who has that URL can post to your channel. Because of that, listing or getting webhooks returns a masked target: its scheme and host, an ellipsis, and the last 4 characters of its path, never its query. Deliveries still go to the full URL you stored. You cannot edit a webhook. To change one, delete it and create it again. Creating a webhook stays in the admin portal because it requires confirming your identity first.

Any signed-in person in your organization can get a repository’s settings. Changing one takes the Manage repositories permission. Turning Public Access off turns the repository’s package pages off too. Four changes stay in the admin portal, because each takes a confirmation of your identity first: turning Public Access on, turning Overwrite Protection off, turning package pages on and clearing a proxy repository’s cache.

Each operation takes a signed-in user’s session in the Authorization header using the HTTP bearer scheme. The session is a JWT, and the OpenAPI file names this scheme portalSession. Without a valid session, each operation returns 401. Any other refusal returns its status and, when the response has a body, an error field explaining why.

Create a group repository

POST /api/group-repository

Creates a group repository in your organization: one repository your build tools read from, which serves the files of the repositories you add to it as members. Set repositoryLocation to group. The id follows a repository's rules: 1 to 32 letters, digits, hyphens or underscores, stored in lower case. The type is maven or docker, and maven when it is left out. An id already in use is refused with 409.

Request body, as JSON:

FieldTypeRequired
idstringyes
repositoryLocationstringyes
typestringno

Answers 201: Created. The body is a JSON object with:

FieldTypeAlways present
repositoryIdstringyes

Add a member to a group

POST /api/group-repository/{repository-id}/member/{member-id}

Adds the repository member-id to the group repository-id. The member must be a repository of the group's type, and a group cannot be its own member. A repository the group already holds is refused with 409. A new member has no priority until you set one.

Path parameters, each a required string: repository-id, member-id.

Answers 201: Added.

Remove a member from a group

DELETE /api/group-repository/{repository-id}/member/{member-id}

Removes the repository member-id from the group repository-id. Only the membership is removed: the member repository and its files stay.

Path parameters, each a required string: repository-id, member-id.

Answers 200: Removed.

Set a member's priority

POST /api/group-repository/{repository-id}/member/{member-id}/priority

Sets the priority of the member member-id in the group repository-id, a whole number. The group reads its members in priority order: the lowest number first. A repository that is not a member of the group is refused with 404.

Path parameters, each a required string: repository-id, member-id.

Request body, as JSON:

FieldTypeRequired
groupPriorityintegeryes

Answers 200: Updated.

List a group's members

GET /api/group-repository/{repository-id}/members

Lists the member repositories of the group repository-id, each with its priority. The group reads its members in priority order: the lowest number first, then the members with no priority, and members of equal priority in order of their ids. A member with no priority has a null groupPriority. A repository that is not a group is refused with 404.

Path parameters, each a required string: repository-id.

Answers 200: The group's members. The body is a JSON list of objects with:

FieldTypeAlways present
groupPriorityinteger or nullyes
repositoryNamestringyes

List repositories

GET /api/repositories

Lists the repositories in your organization.

Answers 200: The repositories. The body is a JSON list of objects with:

FieldTypeAlways present
fileCountintegerno
publicbooleanno
repositoryIdstringyes
repositoryLocationstringno
repositoryTypestringyes
totalFileSizeintegerno

Create a repository

POST /api/repository

Creates a hosted repository in your organization. The id is 1 to 32 letters, digits, hyphens or underscores, stored in lower case, and it names the repository in its URL. The type is maven, npm, pypi or docker, and maven when it is left out. An id already in use is refused with 409.

Request body, as JSON:

FieldTypeRequired
idstringyes
typestringno

Answers 201: Created. The body is a JSON object with:

FieldTypeAlways present
repositoryIdstringyes

Get a repository's top-level contents

GET /api/repository/{repository-id}

Lists what is at the top of a repository: its directories, and its files with their sizes in bytes. In a Docker repository, the directories are its images.

Path parameters, each a required string: repository-id.

Answers 200: The top level of the repository. The body is a JSON object with:

FieldTypeAlways present
directorieslist of stringsyes
fileslist of objectsyes
files[].namestringyes
files[].sizeintegerno
pathstringyes
repositoryIdstringyes

Delete a repository

DELETE /api/repository/{repository-id}

Deletes an empty repository. Files in its Trash and a proxy's cached copies count. A repository that still holds any of these is refused with 409: delete it in the admin portal, which asks you to confirm and sign in again.

Path parameters, each a required string: repository-id.

Answers 200: Deleted.

Turn Public Access off

POST /api/repository/{repository-id}/disable-public-access

Turns Public Access off for the repository repository-id, so every read of it needs a credential again. It turns the repository's package pages off too. It only narrows who can read the repository. Turning Public Access on is not in this reference: it takes a confirmation of your identity, which the admin portal asks for. A repository that is not in your organization, or does not exist, is refused with 404, and one that is being deleted with 409. A signed-in person without the Manage Repositories permission is refused with 403.

Path parameters, each a required string: repository-id.

Answers 200: Updated.

Turn Overwrite Protection on

POST /api/repository/{repository-id}/enable-overwrite-protection

Turns Overwrite Protection on for the repository repository-id: a publish that would replace a file already stored at the same path is then refused with 409, and the stored file stays. It applies to a hosted Maven, npm or PyPI repository. A Docker repository is refused with 400, since it stores images by content digest, and so is a proxy or group repository and any other type. Turning Overwrite Protection off is not in this reference: it takes a confirmation of your identity, which the admin portal asks for. A repository that is not in your organization, or does not exist, is refused with 404, and one that is being deleted with 409. A signed-in person without the Manage Repositories permission is refused with 403.

Path parameters, each a required string: repository-id.

Answers 200: Updated.

Set Snapshot Cleanup

POST /api/repository/{repository-id}/update-snapshot-cleaner

Sets Snapshot Cleanup, a Maven setting, for the repository repository-id. snapshots-to-keep is how many snapshot versions to keep for each GAV, a whole number from 1 to 20, or -1 to turn Snapshot Cleanup off. A body without it, or with a value that is not a whole number (a fraction such as 0.4 included), is 0, is below -1 or is above 20, is refused with 400, and nothing is saved. The repository's settings read it back as snapshotsToKeep. A repository that is not in your organization, or does not exist, is refused with 404, and one that is being deleted with 409. A signed-in person without the Manage Repositories permission is refused with 403.

Path parameters, each a required string: repository-id.

Request body, as JSON:

FieldTypeRequired
snapshots-to-keepintegeryes

Answers 200: Updated.

Get a repository's settings

GET /api/settings/repository/{repository-id}

Gets the settings of the repository repository-id. public says whether Public Access is on. overwriteProtection says whether Overwrite Protection is in force, always true or false: it is on by default on a hosted Maven, npm or PyPI repository, and only those can turn it on. snapshotsToKeep is how many snapshot versions Snapshot Cleanup keeps for each GAV, or -1 when Snapshot Cleanup is off; it is absent when it was never set, which is off too. status is active, or deleting while the repository is being deleted. A repository that is not in your organization, or does not exist, is refused with 404.

Path parameters, each a required string: repository-id.

Answers 200: The repository's settings. The body is a JSON object with:

FieldTypeAlways present
overwriteProtectionbooleanyes
publicbooleanno
repositoryIdstringyes
repositoryLocationstringno
repositoryTypestringyes
snapshotsToKeepintegerno
statusstringyes

List webhooks

GET /api/webhooks

Lists every webhook in your organization, across its repositories, in one answer. Each webhook posts the events of one repository to its target. A Slack target is the incoming-webhook URL Slack gave you, and that URL is a secret: anyone who holds it can post to the channel. So the answer shows each target masked: its scheme and host, then an ellipsis, then the last 4 characters of its path, never its query. Deliveries still go to the full URL you stored. A signed-in person without the Manage Webhooks permission is refused with 403.

Answers 200: Your organization's webhooks. The body is a JSON list of objects with:

FieldTypeAlways present
fireOnDeletebooleanyes
fireOnDownloadbooleanyes
fireOnUploadbooleanyes
repositoryIdstringyes
targetstringyes
webhookIdstringyes
webhookTypestringyes

Get a webhook

GET /api/webhooks/{id}

Gets the webhook id, a webhookId from the list. The answer shows its target masked, as the list does: its scheme and host, then an ellipsis, then the last 4 characters of its path, never its query, since a Slack incoming-webhook URL is a secret. Deliveries still go to the full URL you stored. An id that is not a UUID is refused with 400, and a webhook that is not in your organization, or does not exist, with 404. A signed-in person without the Manage Webhooks permission is refused with 403.

Path parameters, each a required string: id.

Answers 200: The webhook. The body is a JSON object with:

FieldTypeAlways present
fireOnDeletebooleanyes
fireOnDownloadbooleanyes
fireOnUploadbooleanyes
repositoryIdstringyes
targetstringyes
webhookIdstringyes
webhookTypestringyes

Delete a webhook

DELETE /api/webhooks/{id}

Deletes the webhook id. Only the webhook is deleted: its repository and the repository's files stay. An id that is not a UUID is refused with 400, and a webhook that is not in your organization, or does not exist, with 404. A signed-in person without the Manage Webhooks permission is refused with 403.

Path parameters, each a required string: id.

Answers 200: Deleted.

This site publishes no other operation of the management API today, and what it does not publish is not a statement about the product. For automation of your packages, use a repository token against your repository host, as the pages above show. If you need an operation that no page here covers, write to support@cloudrepo.io.

If a link from the old API reference brought you here, this table sends you to the page for the task:

You were looking for Go to
Downloading, uploading or checking a file in a Maven, npm or Python repository, hosted or proxy The format pages in the first table above
Creating or deleting a repository; Public Access, Overwrite Protection, Snapshot Cleanup, clearing a proxy repository’s cache, the members of a group repository Repository Management and Proxy Repositories
Creating or deleting users, granting permissions, changing a password User Management
Webhooks Webhooks
Plan, payment method and payment history Billing in the admin portal, for a user with the Manage billing permission (User Management)
npm sign-in, whoami and removing a package npm repositories
Token and credential questions Repository Tokens
View as Markdown