# Update 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



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

Updates a personal access token partially. You can either update the token's label or enable/disable it.


## 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 PATCH \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "is_active": false,
  "token_label": "My read only token"
}' \
  '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

### Request  application/json




Schema:

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




Schema example:
```json
{
  "is_active": false,
  "token_label": "My read only token"
}
```


### Response 200 application/json

OK


Schema:

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




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 400 application/json

Bad Request


Schema:

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




error:
```json
{
  "errinfo": null,
  "message": "bad request"
}
```


### Response 401 application/json

Unauthorized


Schema:

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




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


## Complete operation contract

```json
{
  "description": "Updates a personal access token partially. You can either update the token's label or enable/disable it.\n",
  "operationId": "patchV2AccessTokensByUuid",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/patchAccessTokenRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/patchAccessTokenResponse"
          }
        }
      },
      "description": "OK"
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "summary": "Update personal access token",
  "tags": [
    "access-tokens"
  ]
}
```

## Referenced schemas

- `#/components/responses/BadRequest`

- `#/components/responses/Unauthorized`

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

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




