---
title: "Update a personal access token"
method: PATCH
path: "/api/v2/personal_access_tokens/{token_id}"
tags: ["Key Management"]
---

# Update a personal access token

`PATCH /api/v2/personal_access_tokens/{token_id}`

Update a specific personal access token.

## Path parameters

- `token_id` string, required

## Request body

- PersonalAccessTokenUpdateRequest — Request used to update an access token.
  - `data` PersonalAccessTokenUpdateData, required — Object used to update an access token.
    - `attributes` PersonalAccessTokenUpdateAttributes, required — Attributes used to update an access token.
      - `name` string — Name of the access token.
      - `scopes` string[] — Array of scopes to grant the access token.
    - `id` string, required — ID of the access token.
    - `type` 'personal_access_tokens', required — Personal access tokens resource type.

## Response `200`

OK

- PersonalAccessTokenResponse — Response for retrieving an access token.
  - `data` PersonalAccessToken — Datadog access token.
    - `attributes` PersonalAccessTokenAttributes — Attributes of an access token.
      - `created_at` string, date-time — Creation date of the access token.
      - `expires_at` string, date-time, nullable — Expiration date of the access token.
      - `last_used_at` string, date-time, nullable — Date the access token was last used.
      - `modified_at` string, date-time, nullable — Date of last modification of the access token.
      - `name` string — Name of the access token.
      - `public_portion` string — The public portion of the access token.
      - `scopes` string[] — Array of scopes granted to the access token.
    - `id` string — ID of the access token.
    - `relationships` PersonalAccessTokenRelationships — Resources related to the access token.
      - `owned_by` RelationshipToUser — Relationship to user.
        - `data` RelationshipToUserData, required — Relationship to user object.
          - `id` string, required — A unique identifier that represents the user.
          - `type` 'users', required — Users resource type.
    - `type` 'personal_access_tokens' — Personal access tokens resource type.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
