# Get personal access token


[API catalog](/reference/api/) · [Docker Hub overview](/reference/api/hub/latest/) · [Product manual](https://docs.docker.com/docker-hub/) · [OpenAPI specification](/reference/api/hub/latest.yaml)

API version: 2-beta



`GET /v2/access-tokens/{uuid}`

Returns a personal access token by UUID.

## Connection and access

[API connection and authentication guidance](/reference/api/hub/latest/#authentication)


Server: `https://hub.docker.com`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "bearerAuth": []
  }
]
```
## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://hub.docker.com/v2/access-tokens/<UUID>'
```

## Parameters

### uuid

Location: path. Required: yes.

UUID of the personal access token.

```json
{
  "description": "UUID of the personal access token.",
  "in": "path",
  "name": "uuid",
  "pointer": "/paths/~1v2~1access-tokens~1{uuid}/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

OK


Schema:

```json
{
  "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:
```json
{
  "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 application/json

Unauthorized


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "unauthorized"
}
```


### Response 404 application/json

Not Found


Schema:

```json
{
  "$ref": "#/components/schemas/error"
}
```




error:
```json
{
  "errinfo": null,
  "message": "not found"
}
```


## Complete operation contract

```json
{
  "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"
  ]
}
```

## Referenced schemas

- `#/components/responses/NotFound`

- `#/components/responses/Unauthorized`

- [#/components/schemas/accessToken](/reference/api/hub/latest/schemas/accessToken/)




