Share feedback
Answers are generated based on the documentation.

Hosted API

Docker Hub API

API 2-beta · 54 operations · 69 named schemas

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.

Connecting to the Docker Hub API

scimToken

Use the SCIM provisioning token configured for the organization.
https://hub.docker.com

Set up SCIM provisioning

Changelog

See the Changelog for a summary of changes across Docker Hub API versions.

Resources

The following resources are available to interact with the documented API:

Rate Limiting

The Docker Hub API is limited on the amount of requests you can perform per minute against it.

If you haven't hit the limit, each request to the API will return the following headers in the response.

  • X-RateLimit-Limit - The limit of requests per minute.
  • X-RateLimit-Remaining - The remaining amount of calls within the limit period.
  • X-RateLimit-Reset - The unix timestamp of when the remaining resets.

If you have hit the limit, you will receive a response status of 429 and the Retry-After header in the response.

The Retry-After header specifies the number of seconds to wait until you can call the API again.

Note: These rate limits are separate from anti-abuse and Docker Hub download, or pull rate limiting. To learn more about Docker Hub pull rate limiting, see Usage and limits.

Authentication

Most Docker Hub API endpoints require you to authenticate using your Docker credentials before using them.

Additionally, similar to the Docker Hub UI features, API endpoint responses may vary depending on your subscription (Personal, Pro, or Team) and your account's permissions.

To learn more about the features available in each subscription and to upgrade your existing subscription, see Docker Pricing.

Types

The Docker Hub API supports the following authentication types.

You must use each authentication type with the Create access token route to obtain a bearer token.

Password

Using a username and password is the most powerful, yet least secure way to authenticate with Docker as a user. It allows access to resources for the user without scopes.

In general, it is recommended to use a personal access token (PAT) instead.

The password authentication type is not available if your organization has SSO enforced.

Personal Access Token (PAT)

Using a username and PAT is the most secure way to authenticate with Docker as a user. PATs are scoped to specific resources and scopes.

Currently, a PAT is a more secure password due to limited functionality. In the future, we may add fine-grained access like organization access tokens for enhanced usage and security.

Organization Access Token (OAT)

Organization access tokens are scoped to specific resources and scopes in an organization. They are managed by organization owners.

These tokens are meant for automation and are not meant to be used by users.

Operations that support bearer tokens issued from OATs state this in their descriptions.

Authentication

The authentication endpoints allow you to authenticate with Docker Hub APIs.

For more information, see Authentication.

Personal Access Tokens

The Personal Access Token endpoints lets you manage personal access tokens. For more information, see Access Tokens.

You can use a personal access token instead of a password in the Docker CLI or in the Create an authentication token route to obtain a bearer token.

Scopes

For each scope grouping (in this case "repo"), you only need to define 1 scope as any lower scopes are assumed. For example: If you define repo:write, the API assumes the scope of both repo:read and repo:public_read as well. If you were to define both repo:write and repo:read, then repo:read is assumed by repo:write and ignored.

Treat your personal access token like your password and keep it secret. You cannot retrieve your token after it is generated.

Audit Logs

The Audit Logs API endpoints allow you to query audit log events across a namespace.

For more information, see Audit Logs.

Org Settings

The Org Settings API endpoints allow you to manage your organization's settings.

Repositories

The repository endpoints allow you to access your repository's tags.

Organizations

The organization endpoints allow you to interact with and manage your organizations.

For more information, see Organization administration overview.

Groups (Teams)

The groups endpoints allow you to manage your organization's teams and their members.

For more information, see Create and manage a team.

Invites

The invites endpoints allow you to manage invites for users to join your Docker organization.

For more information, see Invite members.

SCIM

SCIM is a provisioning system that lets you manage users within your identity provider (IdP).

For more information, see System for Cross-domain Identity management.

Organization Access Tokens

The organization access token endpoints allow you to manage organization access tokens (OATs). See Organization access tokens for more information.

OATs only authenticate requests to the modern namespace-scoped routes under /v2/namespaces/{namespace}/repositories/. Legacy repository paths are OAT unsupported, regardless of the token's scopes, and reject every OAT with 403 token issued from organization access token is not allowed:

Operations

GET/v2/access-tokensList personal access tokens POST/v2/access-tokensCreate personal access token GET/v2/access-tokens/{uuid}Get personal access token DELETE/v2/access-tokens/{uuid}Delete personal access token PATCH/v2/access-tokens/{uuid}Update personal access token GET/v2/auditlogs/{account}List audit log events GET/v2/auditlogs/{account}/actionsList audit log actions POST/v2/auth/tokenCreate access token POST/v2/invites/bulkBulk create invites DELETE/v2/invites/{id}Cancel an invite PATCH/v2/invites/{id}/resendResend an invite GET/v2/namespaces/{namespace}/repositoriesList repositories in a namespace POST/v2/namespaces/{namespace}/repositoriesCreate a new repository GET/v2/namespaces/{namespace}/repositories/{repository}Get repository in a namespace HEAD/v2/namespaces/{namespace}/repositories/{repository}Check repository in a namespace PATCH/v2/namespaces/{namespace}/repositories/{repository}/immutabletagsUpdate repository immutable tags POST/v2/namespaces/{namespace}/repositories/{repository}/immutabletags/verifyVerify repository immutable tags GET/v2/namespaces/{namespace}/repositories/{repository}/tagsList repository tags HEAD/v2/namespaces/{namespace}/repositories/{repository}/tagsCheck repository tags GET/v2/namespaces/{namespace}/repositories/{repository}/tags/{tag}Read repository tag HEAD/v2/namespaces/{namespace}/repositories/{repository}/tags/{tag}Check repository tag GET/v2/orgs/{name}/access-tokensList access tokens POST/v2/orgs/{name}/access-tokensCreate access token GET/v2/orgs/{name}/settingsGet organization settings PUT/v2/orgs/{name}/settingsUpdate organization settings GET/v2/orgs/{org_name}/access-tokens/{access_token_id}Get access token DELETE/v2/orgs/{org_name}/access-tokens/{access_token_id}Delete access token PATCH/v2/orgs/{org_name}/access-tokens/{access_token_id}Update access token GET/v2/orgs/{org_name}/groupsGet groups of an organization POST/v2/orgs/{org_name}/groupsCreate a new group GET/v2/orgs/{org_name}/groups/{group_name}Get a group of an organization PUT/v2/orgs/{org_name}/groups/{group_name}Update the details for an organization group DELETE/v2/orgs/{org_name}/groups/{group_name}Delete an organization group PATCH/v2/orgs/{org_name}/groups/{group_name}Update some details for an organization group GET/v2/orgs/{org_name}/groups/{group_name}/membersList members of a group POST/v2/orgs/{org_name}/groups/{group_name}/membersAdd a member to a group DELETE/v2/orgs/{org_name}/groups/{group_name}/members/{username}Remove a user from a group GET/v2/orgs/{org_name}/invitesList org invites GET/v2/orgs/{org_name}/membersList org members GET/v2/orgs/{org_name}/members/exportExport org members CSV PUT/v2/orgs/{org_name}/members/{username}Update org member (role) DELETE/v2/orgs/{org_name}/members/{username}Remove member from org POST/v2/repositories/{namespace}/{repository}/groupsAssign a group (Team) to a repository for access GET/v2/scim/2.0/ResourceTypesList resource types GET/v2/scim/2.0/ResourceTypes/{name}Get a resource type GET/v2/scim/2.0/SchemasList schemas GET/v2/scim/2.0/Schemas/{id}Get a schema GET/v2/scim/2.0/ServiceProviderConfigGet service provider config GET/v2/scim/2.0/UsersList users POST/v2/scim/2.0/UsersCreate user GET/v2/scim/2.0/Users/{id}Get a user PUT/v2/scim/2.0/Users/{id}Update a user POST/v2/users/2fa-loginSecond factor authentication POST/v2/users/loginCreate an authentication token

Schemas