API Reference
Open Cloudsmith
DocumentationGuidesAPI Reference
  • General
    • Introduction
    • Rate Limits
    • Error Handling
  • API
    • Collapse icon
      Audit Log
      • Namespace List
        get
      • Repo List
        get
    • Collapse icon
      Broadcasts
      • Create Broadcast Token
        post
    • Collapse icon
      Deny Policy
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Update
        put
    • Collapse icon
      Distros
      • List
        get
      • Read
        get
    • Collapse icon
      Entitlements
      • Create
        post
      • Delete
        delete
      • Disable
        post
      • Enable
        post
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Refresh
        post
      • Reset
        post
      • Sync
        post
    • Collapse icon
      Files
      • Abort
        post
      • Complete
        post
      • Create
        post
      • Info
        get
      • Validate
        post
    • Collapse icon
      Formats
      • List
        get
      • Read
        get
    • Collapse icon
      Invites
      • Create
        post
      • Delete
        delete
      • Extend
        post
      • List
        get
      • Partial Update
        patch
      • Resend
        post
    • Collapse icon
      License Policy
      • Collapse icon
        Evaluation
        • Create
          post
        • List
          get
        • Read
          get
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Update
        put
    • Collapse icon
      Members
      • Collapse icon
        Update
        • Role
          patch
        • Visibility
          patch
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Refresh
        post
      • Remove
        get
    • Collapse icon
      Metrics
      • Collapse icon
        Entitlements
        • Account List
          get
        • Repo List
          get
      • Packages List
        get
    • Collapse icon
      Namespaces
      • List
        get
      • Read
        get
    • Collapse icon
      Openid Connect
      • Collapse icon
        Dynamic Mappings
        • List
          get
        • Read
          get
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Update
        put
    • Collapse icon
      Orgs
      • Delete
        delete
      • List
        get
      • Read
        get
    • Collapse icon
      Packages
      • Collapse icon
        Upload
        • Alpine
          post
        • Cargo
          post
        • Cocoapods
          post
        • Composer
          post
        • Conan
          post
        • Conda
          post
        • Cran
          post
        • Dart
          post
        • Deb
          post
        • Docker
          post
        • Go
          post
        • Helm
          post
        • Hex
          post
        • Huggingface
          post
        • Luarocks
          post
        • Maven
          post
        • Npm
          post
        • Nuget
          post
        • P2
          post
        • Python
          post
        • Raw
          post
        • Rpm
          post
        • Ruby
          post
        • Swift
          post
        • Terraform
          post
        • Vagrant
          post
      • Collapse icon
        Validate Upload
        • Alpine
          post
        • Cargo
          post
        • Cocoapods
          post
        • Composer
          post
        • Conan
          post
        • Conda
          post
        • Cran
          post
        • Dart
          post
        • Deb
          post
        • Docker
          post
        • Go
          post
        • Helm
          post
        • Hex
          post
        • Huggingface
          post
        • Luarocks
          post
        • Maven
          post
        • Npm
          post
        • Nuget
          post
        • P2
          post
        • Python
          post
        • Raw
          post
        • Rpm
          post
        • Ruby
          post
        • Swift
          post
        • Terraform
          post
        • Vagrant
          post
      • Copy
        post
      • Delete
        delete
      • Dependencies
        get
      • Groups List
        get
      • List
        get
      • Move
        post
      • Quarantine
        post
      • Read
        get
      • Resync
        post
      • Scan
        post
      • Status
        get
      • Tag
        post
      • Update License
        patch
      • Vulnerabilities Osv List
        get
    • Collapse icon
      Quota
      • Collapse icon
        Oss
        • History Read
          get
        • Read
          get
      • History Read
        get
      • Read
        get
    • Collapse icon
      Repo Retention
      • Partial Update
        patch
      • Read
        get
    • Collapse icon
      Repos
      • Collapse icon
        Ecdsa
        • Create
          post
        • List
          get
        • Regenerate
          post
      • Collapse icon
        Geoip
        • Disable
          post
        • Enable
          post
        • Partial Update
          patch
        • Read
          get
        • Test
          post
        • Update
          put
      • Collapse icon
        Gpg
        • Create
          post
        • List
          get
        • Regenerate
          post
      • Collapse icon
        Privileges
        • List
          get
        • Partial Update
          patch
        • Update
          put
      • Collapse icon
        Rsa
        • Create
          post
        • List
          get
        • Regenerate
          post
      • Upstream
        • Collapse icon
          Cargo
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Composer
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Conda
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Cran
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Dart
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Deb
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Docker
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Go
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Helm
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Hex
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Huggingface
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Maven
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Npm
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Nuget
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Python
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Rpm
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Ruby
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
        • Collapse icon
          Swift
          • Create
            post
          • Delete
            delete
          • List
            get
          • Partial Update
            patch
          • Read
            get
          • Update
            put
      • Collapse icon
        X509
        • Ecdsa List
          get
        • Rsa List
          get
      • Create
        post
      • Delete
        delete
      • Namespace List
        get
      • Partial Update
        patch
      • Read
        get
      • Transfer Region
        post
      • User List
        get
    • Collapse icon
      Saml Authentication
      • Partial Update
        patch
      • Read
        get
    • Collapse icon
      Saml Group Sync
      • Create
        post
      • Delete
        delete
      • Disable
        post
      • Enable
        post
      • List
        get
      • Status
        get
    • Collapse icon
      Services
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Refresh
        post
    • Collapse icon
      Storage Regions
      • List
        get
      • Read
        get
    • Collapse icon
      Teams
      • Collapse icon
        Members
        • Create
          post
        • List
          get
        • Update
          put
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
    • Collapse icon
      User
      • Collapse icon
        Tokens
        • Create
          post
        • List
          get
        • Refresh
          put
      • Self
        get
      • Token Create
        post
    • Collapse icon
      Vulnerabilities
      • Namespace List
        get
      • Package List
        get
      • Read
        get
      • Repo List
        get
    • Collapse icon
      Vulnerability Policy
      • Collapse icon
        Evaluation
        • Create
          post
        • List
          get
        • Read
          get
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
      • Update
        put
    • Collapse icon
      Webhooks
      • Create
        post
      • Delete
        delete
      • List
        get
      • Partial Update
        patch
      • Read
        get
    • Collapse icon
      Workspaces Policies
      • Collapse icon
        Actions
        • Create
          post
        • Destroy
          delete
        • List
          get
        • Partial Update
          patch
        • Retrieve
          get
        • Update
          put
      • Create
        post
      • Decision Logs List
        get
      • Destroy
        delete
      • List
        get
      • Partial Update
        patch
      • Retrieve
        get
      • Simulate List
        get
      • Update
        put
    • Api Repos Geoip Status
      get
    • Badges Version List
      get
    • License Policy Violation List
      get
    • Rates Limits List
      get
    • Status Check Basic
      get
    • Users Profile Read
      get
    • Vulnerability Policy Violation List
      get

The Cloudsmith REST (REpresentational State Transfer) API (Application Programming Interface) provides everything you love about Cloudsmith but in a programmatic machine-accessible RESTful format. We believe in providing a rich API to enable exciting and powerful integrations, hopefully in ways that we couldn't imagine - just like your favourite brick-like toys.

Versioning

The API is versioned to help reduce future compatibility issues if we need to change the API.

Authentication

Most resources provided by the API require some form of authentication, which identifies the client to the API in the context of a particular user. Other resources are accessible anonymously, so they don't need authentication (although they may provide expanded detail for authenticated users). You can use the following methods to authenticate:

Basic Authentication

The simplest (but least recommended) way to authenticate is to provide your login email and password when making API requests (replacing email with your username and password with your password):

bash
curl -u "email:password" https://api.cloudsmith.io/user/self/

Specifying an invalid email and/or password will result in an 401 Unauthorized status code, and the body will specify that invalid credentials were received. Let's see it in action:

bash
curl -i -u "example:wrongpassword" -X OPTIONS https://api.cloudsmith.io/user/self/

HTTP/2 401
date: Thu, 09 Mar 2023 16:52:55 GMT
server: Cloudsmith MCP

{"detail": "Invalid username/password."}

Warning

Disclosure of your email and password will allow a malicious third-party to takeover your account and cause damage. We recommend using an API Key instead and using a lesser privileged account for API access.

Instead of providing your email and password, it is recommended that you instead authenticate to the API by specifying your API Key.

API Key Authentication

Getting your API Key

You can find your API Key within your User Settings or you can request (or reset) it via the Users Token API Endpoint.

Cloudsmith Entitlement Tokens cannot be used to authenticate to the Cloudsmith API. Entitlement Tokens are used to authenticate for package downloads only.

You can specify your API Key via the X-Api-Key header when making requests (replacing key with your actual API Key):

bash
curl -H "X-Api-Key: key" https://api.cloudsmith.io/user/self/

You can also specify your API Key via the Authorization header when making requests (replacing key with your actual API Key):

bash
curl -H "Authorization: token key" https://api.cloudsmith.io/user/self/

Specifying an invalid API Key will result in an 401 Unauthorized status code, and the body will specify that an invalid token was received. Let's see it in action:

bash
curl -i -H "X-Api-Key: foobar" -X OPTIONS https://api.cloudsmith.io/user/self/

HTTP/2 401
date: Thu, 09 Mar 2023 16:55:35 GMT
server: Cloudsmith MCP

{"detail": "Invalid token."}

Use Service Accounts

If your API key is given to someone else they will be able to access the API in its entirety as you (although they won't be able to login to the website itself, which makes this method slightly more secure that using Basic Authentication). This should be viewed as a security risk and every effort should be taken to protect your API Key from disclosure. If you need to add read-only access, we suggest creating a lesser privileged service account and using that instead for scripts/automation.

Pagination

API requests that return more than one item may be paginated, which simply means the total number of items is split into logical pages, in the same way that a book is split into pages. Each page will have a certain number of items in it from one up to the page limit - empty datasets are never paginated.

When pagination is enabled, the following query string parameters are supported:

ParameterDescription
pageThe current page of the pagination dataset to view. The page number is 1-based, so omitting or specifying a non-positive number will return the first page.
page_sizeThe page size to divide the dataset into. The default amount (if not specified) is 30 items per page and the maximum configurable is 500 items per page.

When pagination occurs, the following headers will be represent in API responses:

HeaderDescription
Link (based on H+C6988)Hypermedia links for the previous page (if any) and for the next page (if any). Some of which may require expansion as URI templates.
X-Pagination-CountThe total number of items in the dataset.
X-Pagination-PageThe number of the current page.
X-Pagination-PageTotalThe total number of pages in the dataset.
X-Pagination-PageSizeThe size of each page in the dataset.

The Link header can contain the following rel values:

NameDescription
firstThe link relation to the first page of results. This will only be present if there is more than one page.
prevThe link relation to the previous page of results. This will only be present if the client has requested a page greater than 1.
nextThe link relation to the next page of results. This will only be present if the client has requested a page less than the last/final page.
lastThe link relation to the last/final page of results. This will only be present if there is more than one page.

Let's see it in action

bash
curl -i -H "X-Api-Key: key" 'https://api.cloudsmith.io/package/example/repo/packages/?page=2&page_size=1'
HTTP/1.0 200 OK
Allow: GET, OPTIONS
Content-Type: application/json
Link: <https://api.cloudsmith.io/package/example/repo/packages/?page=1>; rel="first", <https://api.cloudsmith.io/package/example/repo/packages/?page=1>; rel="prev", <https://api.cloudsmith.io/package/example/repo/packages/?page=3>; rel="next", <https://api.cloudsmith.io/package/example/repo/packages/?page=3>; rel="last"
X-Pagination-Count: 3
X-Pagination-Page: 2
X-Pagination-PageTotal: 3
X-Pagination-PageSize: 1
Server: Cloudsmith MCP
Date: Sun, 29 Jan 2017 18:40:55 GMT

[snip]

Page Sizes / Remainders

If the page size is 100 and the dataset size is 400, then there will be four pages available for retrieval. If the dataset isn't cleanly divided by the page size, the remainder will be on the final page. For example, if the page size is 100 and the dataset size is 350 then the last (4th) page will have 50 items on it.

Updated last month