Share feedback
Answers are generated based on the documentation.

Get personal access token

GET/v2/access-tokens/{uuid}
Returns a personal access token by UUID.

Connection and access

API connection and authentication guidance

https://hub.docker.com — Docker HUB API

Use one of these alternatives. Requirements within an alternative apply together.

  • bearerAuth

Parameters

uuid path Required

UUID of the personal access token.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

Request and responses

Response 200

OK

application/json

All constraints apply

Schema: accessToken

Type: object

token

Type: string

All schema constraints and annotations
{
  "example": "***",
  "type": "string"
}
All schema constraints and annotations
{
  "properties": {
    "token": {
      "example": "***",
      "type": "string"
    }
  },
  "type": "object"
}
All schema constraints and annotations
{
  "allOf": [
    {
      "$ref": "#/components/schemas/accessToken"
    },
    {
      "properties": {
        "token": {
          "example": "***",
          "type": "string"
        }
      },
      "type": "object"
    }
  ],
  "examples": [
    {
      "client_id": "HUB",
      "created_at": "2021-07-20T12:00:00.000000Z",
      "creator_ip": "127.0.0.1",
      "creator_ua": "some user agent",
      "expires_at": "2021-10-28T18:30:19.520861Z",
      "generated_by": "manual",
      "is_active": true,
      "last_used": null,
      "scopes": [
        "repo:read"
      ],
      "token": "***",
      "token_label": "My read only token",
      "uuid": "b30bbf97-506c-4ecd-aabc-842f3cb484fb"
    }
  ]
}

Schema example

{
  "client_id": "HUB",
  "created_at": "2021-07-20T12:00:00.000000Z",
  "creator_ip": "127.0.0.1",
  "creator_ua": "some user agent",
  "expires_at": "2021-10-28T18:30:19.520861Z",
  "generated_by": "manual",
  "is_active": true,
  "last_used": null,
  "scopes": [
    "repo:read"
  ],
  "token": "***",
  "token_label": "My read only token",
  "uuid": "b30bbf97-506c-4ecd-aabc-842f3cb484fb"
}

Response 401

Unauthorized

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "unauthorized"
}

Response 404

Not Found

application/json

Schema: error

error

{
  "errinfo": null,
  "message": "not found"
}

Referenced schemas

#/components/schemas/accessToken

Complete operation contract
{
  "description": "Returns a personal access token by UUID.",
  "operationId": "getV2AccessTokensByUuid",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "allOf": [
              {
                "$ref": "#/components/schemas/accessToken"
              },
              {
                "properties": {
                  "token": {
                    "example": "***",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            ],
            "examples": [
              {
                "client_id": "HUB",
                "created_at": "2021-07-20T12:00:00.000000Z",
                "creator_ip": "127.0.0.1",
                "creator_ua": "some user agent",
                "expires_at": "2021-10-28T18:30:19.520861Z",
                "generated_by": "manual",
                "is_active": true,
                "last_used": null,
                "scopes": [
                  "repo:read"
                ],
                "token": "***",
                "token_label": "My read only token",
                "uuid": "b30bbf97-506c-4ecd-aabc-842f3cb484fb"
              }
            ]
          }
        }
      },
      "description": "OK"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "Get personal access token",
  "tags": [
    "access-tokens"
  ]
}