---
title: "Update service-account token"
method: PATCH
path: "/api/organizations/{name}/service-accounts/{serviceAccountId}/tokens/{tokenId}"
tags: ["service-accounts"]
---

# Update service-account token

`PATCH /api/organizations/{name}/service-accounts/{serviceAccountId}/tokens/{tokenId}`

## Request

- Base URL: `https://huggingface.co`
- URL: `https://huggingface.co/api/organizations/{name}/service-accounts/{serviceAccountId}/tokens/{tokenId}`
- Auth: HTTP bearer

Update the name and/or permissions of an existing service account token.

## Path parameters

- `name` string, required
- `serviceAccountId` string, required
- `tokenId` string, required

## Request body

- object
  - `displayName` string: New display name for the token
  - `permissions` string[]: Org-wide permissions for this token
  - `repoIds` string[]: Repositories to grant `repoPermissions` on. Can be repositories owned by the organization or any public repository. These override the org-wide permissions.
  - `repoPermissions` string[]: Permissions granted on the selected `repoIds`.
  - `endpointPatterns` string[]: Inference endpoint name patterns (wildcards allowed, e.g. `gpt2-*`) restricting the token's org-wide Inference Endpoint permissions to matching endpoints. Empty means all endpoints.
  - `skipNetworkSecurity` boolean: Exempt this token from the org's Network Security enforcement (IP allowlist and content access policy). Enterprise Plus only, and requires the `org.networkSecurity.write` permission.

## Response `200`

Updated token info

- object
  - `_id` string, required
  - `displayName` string, required
  - `permissions` string[], required
  - `repoIds` string[], required
  - `repoPermissions` string[], required
  - `endpointPatterns` string[], required
  - `skipNetworkSecurity` boolean, required

## Changes

- **2026-10-01** `02f8596075cd`: 1 info
  - added the new `repo.contribute.write` enum value to the request property `permissions/items/`
- **2026-09-08** `bd17546f47b8`: 2 breaking
  - the `permissions/items/` request property type changed from no type to `string`
  - the `repoPermissions/items/` request property type changed from no type to `string`
- **2026-08-19** `bfd4937641f1`: 1 info
  - added the new `org.auditLog.write` enum value to the request property `permissions/items/`
- **2026-08-05** `17e54bbf244f`: 2 info
  - added the new optional request property `skipNetworkSecurity`
  - added the required property `skipNetworkSecurity` to the response with the `200` status
- **2026-07-26** `36390f25f00f`: 6 info
  - added the new optional request property `endpointPatterns`
  - added the new optional request property `repoIds`
  - added the new optional request property `repoPermissions`
  - added the required property `endpointPatterns` to the response with the `200` status
  - …2 more

[Operation history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/organizations/:name/service-accounts/:serviceAccountId/tokens/:tokenId/patch.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) - [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) - [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/5cabdcc8a394?raw)
