Docker

Docker HUB API

Docker Hub is a service provided by Docker for finding and sharing container images with your team. It is the world's largest library and community for…

Developer tools#openapi#developer-tools

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Docker Hub is a service provided by Docker for finding and sharing container
images with your team.

It is the world's largest library and community for container images.

In addition to the Docker Hub UI and Docker Hub CLI tool (currently experimental),

Docker provides an API that allows you to interact with Docker Hub.

Browse through the Docker Hub API documentation to explore the supported endpoints.

Endpoints 28

authentication

  • POSTSecond factor authentication./v2/users/2fa-loginWhen user has 2FA enabled, this is the second call to perform after /v2/users/login call. Creates and returns a bearer token in JWT format that you can use to…
  • POSTCreate an authentication token/v2/users/loginCreates and returns a bearer token in JWT format that you can use to authenticate with Docker Hub APIs. The returned token is used in the HTTP Authorization…

access-tokens

  • GETGet a list of personal access tokens/v2/access-tokens?page=1&page_size=10Returns a paginated list of personal access tokens.
  • POSTCreate a personal access token/v2/access-tokensCreates and returns a personal access token.
  • GETGet a personal access token/v2/access-tokens/:uuidReturns a personal access token by UUID.
  • DELETEDelete a personal access token/v2/access-tokens/:uuidDeletes a personal access token permanently. This cannot be undone.
  • PATCHUpdate a personal access token/v2/access-tokens/:uuidUpdates a personal access token partially. You can either update the token's label or enable/disable it.

images

  • POSTDelete images/v2/namespaces/:namespace/delete-imagesDeletes one or more images within a namespace. This is currently limited to a single repository. If you attempt to delete images that are marked as active or…
  • GETGet details of repository's images/v2/namespaces/:namespace/repositories/:repository/images?status=active&currently_tagged=true&ordering=last_activity&active_from=string&page=0&page_size=0Gets details on the images in a repository.
  • GETGet summary of repository's images/v2/namespaces/:namespace/repositories/:repository/images-summary?active_from=stringGets the number of images in a repository and the number of images counted as active and inactive.
  • GETGet image's tags/v2/namespaces/:namespace/repositories/:repository/images/:digest/tags?page=0&page_size=0Gets current and historical tags for an image.

audit-logs

  • GETReturns list of audit log events./v2/auditlogs/:account?action=string&name=string&actor=string&from=2024-01-01T00:00:00Z&to=2024-01-01T00:00:00Z&page=1&page_size=25Get audit log events for a given namespace.
  • GETReturns list of audit log actions./v2/auditlogs/:account/actionsGet audit log actions for a namespace to be used as a filter for querying audit events.

org-settings

  • GETGet organization settings/v2/orgs/:name/settingsReturns organization settings by name.
  • PUTUpdate organization settings/v2/orgs/:name/settingsUpdates an organization's settings. Some settings are only used when the organization is on a business plan. *Only users in the "owners" group of the…

repositories

  • GETList repository tags/v2/namespaces/:namespace/repositories/:repository/tags?page=0&page_size=0
  • HEADCheck repository tags/v2/namespaces/:namespace/repositories/:repository/tags
  • GETRead repository tag/v2/namespaces/:namespace/repositories/:repository/tags/:tag
  • HEADCheck repository tag/v2/namespaces/:namespace/repositories/:repository/tags/:tag

scim

  • GETList resource types/v2/scim/2.0/ResourceTypesReturns all resource types supported for the SCIM configuration.
  • GETGet a resource type/v2/scim/2.0/ResourceTypes/:nameReturns a resource type by name.
  • GETList schemas/v2/scim/2.0/SchemasReturns all schemas supported for the SCIM configuration.
  • GETGet a schema/v2/scim/2.0/Schemas/:idReturns a schema by ID.
  • GETGet service provider config/v2/scim/2.0/ServiceProviderConfigReturns a service provider config for Docker's configuration.
  • GETList users/v2/scim/2.0/Users?startIndex=1&count=10&filter=userName eq "jon.snow@docker.com"&attributes=userName,displayName&sortOrder=ascending&sortBy=userNameList users, returns paginated users for an organization. Use startIndex and count query parameters to receive paginated results. Sorting:<br> Sorting lets you…
  • POSTCreate user/v2/scim/2.0/UsersCreates a user. If the user already exists by email, they are assigned to the organization on the "company" team.
  • GETGet a user/v2/scim/2.0/Users/:idReturns a user by ID.
  • PUTUpdate a user/v2/scim/2.0/Users/:idUpdates a user. Use this route to change the user's name, activate, and deactivate the user.

API details

Base URL
https://hub.docker.com
https://docker.com/{version}
Authentication
None declared in the description
Operations
28 operations on 20 pathsGET 17POST 5PUT 2HEAD 2PATCH 1DELETE 1
Main resources
scim 9access-tokens 5images 4repositories 4audit-logs 2authentication 2org-settings 2
Response formats
application/json
Description format
OpenAPI 3.0.0, API version beta
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Docker HUB API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Docker HUB API collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “Second factor authentication.” (POST /v2/users/2fa-login), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Docker HUB API?

Docker Hub is a service provided by Docker for finding and sharing container images with your team. It is the world's largest library and community for… It is listed under Developer tools and has 28 endpoints.

Who publishes the Docker HUB API?

It is listed from Docker's public API description (an OpenAPI document), not published by Docker on Swastik Codes. Anyone who controls docker.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Docker HUB API?

Its description lists 2 base URLs: https://hub.docker.com, https://docker.com/{version}. The first is the usual one; the others are typically sandbox or regional servers.

How do I authenticate with the Docker HUB API?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the Docker HUB API have?

28 operations on 20 paths (17 GET, 5 POST, 2 PUT, 2 HEAD, 1 PATCH, 1 DELETE). The largest groups are scim, access-tokens, images, repositories.

Is forking the Docker HUB API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.