v1
latestOpenAPI 3.0.02026-07-1482113.7 KBauthentication
Create an authentication token
Creates 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 header like Authorization: Bearer {TOKEN}.
Most Docker Hub APIs require this token either to consume or to get detailed information. For example, to list images in a private repository.
post/v2/users/login
Request body
Example request
{
"password": "hunter2",
"username": "myusername"
}Response
Authentication successful
Example response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}