---
title: "Patch access token"
method: PATCH
path: "/api/v2/tokens/{id}"
tags: ["Access tokens"]
---

# Patch access token

`PATCH /api/v2/tokens/{id}`

Update an access token's settings. Updating an access token uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](https://launchdarkly.com/docs/api#updates).

## Path parameters

- `id` string, string, required — The ID of the access token to update

## Request body

- PatchOperation[]
  - `op` string, required — The type of operation to perform
  - `path` string, required — A JSON Pointer string specifying the part of the document to operate on
  - `value` string — A JSON value used in "add", "replace", and "test" operations

## Response `200`

Access token response

- Token
  - `_id` string, required
  - `ownerId` string, required
  - `memberId` string, required
  - `_member` MemberSummary
    - `_links` object, required — The location and content type of related resources
    - `_id` string, required — The member's ID
    - `firstName` string — The member's first name
    - `lastName` string — The member's last name
    - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
    - `email` string, required — The member's email address
  - `name` string — A human-friendly name for the access token
  - `description` string — A description for the access token
  - `creationDate` integer, required
  - `lastModified` integer, required
  - `customRoleIds` ObjectId[] — A list of custom role IDs to use as access limits for the access token
  - `inlineRole` Statement[] — An array of policy statements, with three attributes: effect, resources, actions. May be used in place of a role.
    - `resources` string[] — Resource specifier strings
    - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
    - `actions` ActionSpecifier[] — Actions to perform on a resource
    - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
    - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
  - `role` string — Base role for the token
  - `token` string — The token value. When creating or resetting, contains the entire token value. Otherwise, contains the last four characters.
  - `serviceToken` boolean — Whether this is a service token or a personal token
  - `_links` object, required — The location and content type of related resources
  - `defaultApiVersion` integer — The default API version for this token
  - `lastUsed` integer

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `409` — Status conflict
- `422` — Invalid patch content
- `429` — Rate limited

---

[API](https://skmtc.net/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.net/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/versions/69c5c9aafe78/schema)
