# API Reference

> What CloudRepo offers through its API today: the package protocols on your repository host, and the management API behind the admin portal. Where each task from the old per-endpoint pages lives now.

CloudRepo has two HTTP surfaces: the package protocols on your repository host, which your build tools speak, and a management API, which the admin portal speaks. This page says what each one takes today and where the pages for the old per-endpoint API reference went.

## Your repository host

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

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

You do not write HTTP against it by hand for packages: your package manager does, in the protocol of the 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](/docs/publish/maven.html), [Pull Maven artifacts](/docs/consume/maven.html), [Publish Gradle artifacts](/docs/publish/gradle.html), [Pull Gradle dependencies](/docs/consume/gradle.html) |
| npm              | The npm registry protocol.                                                            | [Publish npm packages](/docs/publish/npm.html), [Pull npm packages](/docs/consume/npm.html), [npm repositories](/docs/formats/npm.html)                                                                             |
| Python           | The PyPI simple index for installs, and an upload for twine.                          | [Publish Python packages](/docs/publish/python.html), [Pull Python packages](/docs/consume/python.html), [Python repositories](/docs/formats/python.html)                                                           |
| Docker           | The Docker Registry HTTP API V2.                                                      | [Push Docker images](/docs/publish/docker.html), [Pull Docker images](/docs/consume/docker.html), [Docker repositories](/docs/formats/docker.html)                                                                  |

Each request to a private repository carries a [repository token](/docs/authenticate/repository-tokens.html). 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 Maven, Python or npm repository whose **Public Access** is on can be read without a credential. See [Repository Management](/docs/manage/repositories.html#repository-settings) 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](/docs/reference/error-codes.html) lists the codes, and [Troubleshooting](/docs/reference/troubleshooting.html) walks from a status to a fix.

## The management API

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.

CloudRepo has no key made for scripts to call the management API, and this site publishes no per-endpoint reference for it. What it does not publish is not a statement about the product. For automation, 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>.

## Where the old per-endpoint pages went

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](/docs/manage/repositories.html) and [Proxy Repositories](/docs/consume/proxy-repositories.html)         |
| Creating or deleting users, granting permissions, changing a password                                                                                            | [User Management](/docs/manage/users.html)                                                                                      |
| Webhooks                                                                                                                                                         | [Webhooks](/docs/manage/webhooks.html)                                                                                          |
| Plan, payment method and payment history                                                                                                                         | **Billing** in the admin portal, for a user with the **Manage Billing** permission ([User Management](/docs/manage/users.html)) |
| npm sign-in, whoami and removing a package                                                                                                                       | [npm repositories](/docs/formats/npm.html)                                                                                      |
| Token and credential questions                                                                                                                                   | [Repository Tokens](/docs/authenticate/repository-tokens.html)                                                                  |

---

The page: https://www.cloudrepo.io/docs/reference/api.html
