Download OpenAPI specification: Download
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.
Most Docker Hub API endpoints require you to authenticate using your Docker credentials. Additionally, similar to the Docker Hub UI features, API endpoint responses may vary depending on your plan (Free, Pro, or Team) and your account's permissions.
To learn more about the features available in each plan and to upgrade your existing plan, see Docker Pricing.
Creates an authentication token that can be used to authenticate with the Docker Hub APIs. The returned token is used in the HTTP Authentication header like Most Docker Hub APIs require this token either to consume or to get detailed information. For example, to list images in a private repository.Authentication: JWT {TOKEN}
.
Login details.
username null |
string
Required
The username of the Docker Hub account to authenticate with. |
|
|
password null |
string
Required
The password of the Docker Hub account to authenticate with. |
|
200 Authentication successful
401 Authentication failed
{}
"username": "myusername", "password": "hunter2"
200 Authentication successful
401 Authentication failed
{}
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
{}
"details": "Incorrect authentication credentials"
The Advanced Image Management API endpoints allow you to manage Docker images across all repositories.
For more information, see Advanced Image Management dashboard.
Gets the number of images in a repository and the number of images counted as active and inactive.
Namespace of the repository.
Name of the repository.
Sets the time from which an image must have been pushed or pulled to be counted as active.
Defaults to 1 month before the current time.
200 Success
401 Unauthorized - user does not have read access to the namespace
200 Success
401 Unauthorized - user does not have read access to the namespace
{}
"active_from": "2021-01-25T14:25:37.076343059Z", "statistics": {}
"total": 3, "active": 2, "inactive": 1
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
Gets details on the images in a repository.
Namespace of the repository.
Name of the repository.
Filters to only show images of this status.
Filters to only show images with:
true
: at least 1 current tag.false
: no current tags.Orders the results by this property.
Prefixing with -
sorts by descending order.
Sets the time from which an image must have been pushed or pulled to be counted as active.
Defaults to 1 month before the current time.
Page number to get. Defaults to 1.
Number of images to get per page. Defaults to 10. Max of 100.
200 Success
401 Unauthorized - user does not have read access to the namespace.
403 Forbidden - this API is only available to users on Pro or Team plans.
200 Success
401 Unauthorized - user does not have read access to the namespace.
403 Forbidden - this API is only available to users on Pro or Team plans.
{}
"count": 100, "results": []
{}
"namespace": "mynamespace", "repository": "myrepo", "digest": "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr", "tags": [],
{}
"tag": "latest", "is_current": true "last_pushed": "2021-02-24T22:05:27.526308Z", "last_pulled": "2021-02-24T23:16:10.200008Z", "status": "active"
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
Gets current and historical tags for an image.
Namespace of the repository.
Name of the repository.
Digest of the image.
Page number to get. Defaults to 1.
Number of images to get per page. Defaults to 10. Max of 100.
200 Success
401 Unauthorized - user does not have read access to the namespace
403 Forbidden - this API is only available to users on Pro or Team plans
200 Success
401 Unauthorized - user does not have read access to the namespace
403 Forbidden - this API is only available to users on Pro or Team plans
{}
"count": 100, "results": []
{}
"tag": "latest", "is_current": true
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
Deletes one or more images within a namespace. This is currently limited to a single repostiory. If you attempt to delete images that are marked as active or are currently tagged, the deletion does not happen and it displays the warnings.
To continue with the deletion, you must ignore these warnings by putting them in the Deleting a currently tagged image deletes the tag from the repository. You cannot ignore errors. It is not possible to directly delete children of multi-arch images.ignore_warnings
property.
Namespace of the repository.
Delete request.
dry_run null |
boolean
If |
|
|
active_from null |
string
Sets the time from which an image must have been pushed or pulled to be counted as active. Defaults to 1 month before the current time. |
|
|
manifests null |
object
Image manifests to delete. |
|
|
ignore_warnings null |
object
Warnings to ignore. If a warning is not ignored then no deletions will happen and the warning is returned in the response. These warnings include:
Warnings can be copied from the response to the request. |
|
200 Deletion completed
400 Deletion not possible
403 Forbidden - this API is only available to users on Pro or Team plans
{}
"dry_run": false, "active_from": "2020-12-01T12:00:00Z", "manifests": [],
{}
"repository": "myrepo", "digest": "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr" "ignore_warnings": []
{}
"repository": "myrepo", "digest": "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr", "warning": "current_tag", "tags": []
"latest"
200 Deletion completed
400 Deletion not possible
403 Forbidden - this API is only available to users on Pro or Team plans
{}
"dry_run": false, "metrics": {}
"manifest_deletes": 3, "manifest_errors": 0, "tag_deletes": 1, "tag_errors": 0
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string", "type": "validation", "details": {}
"errors": [],
{}
"repository": "myrepo", "digest": "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr", "error": "not_found" "warnings": []
{}
"repository": "myrepo", "digest": "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr", "warning": "current_tag", "tags": []
"latest"
{}
"txnid": "string", "message": "string", "errinfo": {}
"api_call_docker_id": "string", "api_call_name": "string", "api_call_start": "string", "api_call_txnid": "string"
The Audit Logs API endpoints allow you to query audit log events across a namespace.
For more information, see Audit Log
Get audit log events for a given namespace.
Namespace to query audit logs for.
action name one of ["repo.tag.push", ...]. Optional parameter to filter specific audit log actions.
name. Optional parameter to filter audit log events to a specific name. For repository events, this is the name of the repository. For organization events, this is the name of the organization. For team member events, this is the username of the team member.
actor name. Optional parameter to filter audit log events to the specific user who triggered the event.
Start of the time window you wish to query audit events for.
End of the time window you wish to query audit events for.
page - specify page number. Page number to get.
page_size - specify page size. Number of events to return per page.
200 A successful response.
429
500
default An unexpected error response.
200 A successful response.
429
500
default An unexpected error response.
{}
"logs": []
{}
"account": "docker", "action": "repo.tag.push", "name": "docker/example", "actor": "docker", "data": {},
"digest": "sha256:c1ae9c435032a276f80220c7d9b40f76266bbe79243d34f9cda30b76fe114dfa", "tag": "latest" "timestamp": "2021-02-19T01:34:35Z", "action_description": "pushed the tag latest with the digest sha256:c1ae9c435032a to the repository docker/example"
{}
"detail": "Rate limit exceeded", "error": false
Sample unavailable
{}
"code": 0, "message": "string", "details": []
{}
"type_url": "string", "value": "string"
Get audit log actions for a namespace to be used as a filter for querying audit events.
Namespace to query audit log actions for.
200 A successful response.
429
500
default An unexpected error response.
200 A successful response.
429
500
default An unexpected error response.
{}
"actions": {}
"org": {},
"actions": [],
{},
"name": "team.create", "description": "contains team create events", "label": "Team Created" {},
"name": "team.delete", "description": "contains team delete events", "label": "Team Deleted" {},
"name": "team.member.add", "description": "contains team member add events", "label": "Team Member Added" {},
"name": "team.member.remove", "description": "contains team member remove events", "label": "Team Member Removed" {},
"name": "team.member.invite", "description": "contains team member invite events", "label": "Team Member Invited" {},
"name": "member.removed", "description": "contains org member remove events", "label": "Organization Member Removed" {}
"name": "create", "description": "contains organization create events", "label": "Organization Created" "label": "Organization" "repo": {}
"actions": [],
{},
"name": "create", "description": "contains repository create events", "label": "Repository Created" {},
"name": "delete", "description": "contains repository delete events", "label": "Repository Deleted" {},
"name": "change_privacy", "description": "contains repository privacy change events", "label": "Privacy Changed" {},
"name": "tag.push", "description": "contains image tag push events", "label": "Tag Pushed" {}
"name": "tag.delete", "description": "contains image tag delete events", "label": "Tag Deleted" "label": "Repository"
{}
"detail": "Rate limit exceeded", "error": false
Sample unavailable
{}
"code": 0, "message": "string", "details": []
{}
"type_url": "string", "value": "string"