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
https://hub.docker.comChangelog
Resources
The following resources are available to interact with the documented API:
- Docker Hub CLI tool (currently experimental)
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
Repositories
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:
GET /v2/repositories/{namespace}/{repository}— use Get repository instead.GET /v2/repositories/{namespace}— use List repositories instead.GET /v2/users/{username}/repositories— use List repositories instead.
Operations
/v2/access-tokens List personal access tokens
POST/v2/access-tokens Create 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}/actions List audit log actions
POST/v2/auth/token Create access token
POST/v2/invites/bulk Bulk create invites
DELETE/v2/invites/{id} Cancel an invite
PATCH/v2/invites/{id}/resend Resend an invite
GET/v2/namespaces/{namespace}/repositories List repositories in a namespace
POST/v2/namespaces/{namespace}/repositories Create 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}/immutabletags Update repository immutable tags
POST/v2/namespaces/{namespace}/repositories/{repository}/immutabletags/verify Verify repository immutable tags
GET/v2/namespaces/{namespace}/repositories/{repository}/tags List repository tags
HEAD/v2/namespaces/{namespace}/repositories/{repository}/tags Check 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-tokens List access tokens
POST/v2/orgs/{name}/access-tokens Create access token
GET/v2/orgs/{name}/settings Get organization settings
PUT/v2/orgs/{name}/settings Update 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}/groups Get groups of an organization
POST/v2/orgs/{org_name}/groups Create 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}/members List members of a group
POST/v2/orgs/{org_name}/groups/{group_name}/members Add 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}/invites List org invites
GET/v2/orgs/{org_name}/members List org members
GET/v2/orgs/{org_name}/members/export Export 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}/groups Assign a group (Team) to a repository for access
GET/v2/scim/2.0/ResourceTypes List resource types
GET/v2/scim/2.0/ResourceTypes/{name} Get a resource type
GET/v2/scim/2.0/Schemas List schemas
GET/v2/scim/2.0/Schemas/{id} Get a schema
GET/v2/scim/2.0/ServiceProviderConfig Get service provider config
GET/v2/scim/2.0/Users List users
POST/v2/scim/2.0/Users Create 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-login Second factor authentication
POST/v2/users/login Create an authentication tokenSchemas
AuditLogAuditLogActionAuditLogActionsAuthCreateTokenResponseGetAuditActionsResponseGetAuditLogsResponsePostUsers2FALoginErrorResponsePostUsersLoginErrorResponsePostUsersLoginSuccessResponseRepositoryGroupRepositoryGroupCreationRequestUsers2FALoginRequestUsersLoginRequestaccessTokenbulk_invitecategorycreateAccessTokenRequestcreateAccessTokensResponsecreateOrgAccessTokenRequestcreateOrgAccessTokenResponseemail_addressemail_with_usernameerrorgetAccessTokensResponsegetOrgAccessTokenResponsegetOrgAccessTokensResponsegroup_memberimageimmutable_tags_settingsimmutable_tags_verify_requestimmutable_tags_verify_responseinvitelayerlegacy_email_addresslist_repositories_responseorgAccessTokenorgAccessTokenResourceorgSettingsorg_grouporg_memberorg_member_paginatedpagepaginated_tagspatchAccessTokenRequestpatchAccessTokenResponserepo_creation_requestrepo_permissionsrepository_inforepository_list_entryrestricted_imagesscim_emailscim_errorscim_groupscim_resource_typescim_schemascim_schema_attributescim_schema_parent_attributescim_service_provider_configscim_userscim_user_display_namescim_user_idscim_user_namescim_user_schemasscim_user_usernametagupdateOrgAccessTokenRequestupdateOrgAccessTokenResponseupdate_repository_immutable_tags_requestuser