---
title: "Update API Token"
method: POST
path: "/orgs/{org_slug}/api-tokens/update"
tags: ["api-tokens"]
---

# Update API Token

`POST /orgs/{org_slug}/api-tokens/update`

Update an API Token. The API Token created must use a subset of permissions the API token creating them.

This endpoint consumes 10 units of your quota.

This endpoint requires the following org token scopes:
- api-tokens:create

## Path parameters

- `org_slug` string, required

## Request body

- object
  - `max_quota` integer, required — Maximum number of API calls allowed per hour
  - `scopes` string[], required — List of scopes granted to the API Token
  - `visibility` 'admin' | 'organization', required — The visibility of the API Token. Warning: this field is deprecated and will be removed in the future.
  - `committer` object, required — Committer information to associate with the API Token
    - `email` string — Email address of the committer
    - `provider` 'api' | 'azure' | 'bitbucket' | 'github' | 'gitlab' — The source control provider for the committer
    - `providerLoginName` string — Login name on the provider platform
    - `providerUserId` string — User ID on the provider platform
  - `name` string — Name for the API Token
  - `uuid` string, uuid — The stable group UUID to update (provide uuid, id, token, or hash. May provide uuid+hash together for validation)
  - `id` string — The API token ID to update (provide uuid, id, token, or hash)
  - `token` string — The API token to update (provide uuid, id, token, or hash)
  - `hash` string — The API token hash to update (provide uuid, id, token, or hash)

## Response `200`

The updated token.

- object
  - `hash` string, required — SRI-format hash of the API token (e.g., sha512-base64hash)

## Other responses

- `401` — Unauthorized
- `403` — Insufficient max_quota for API method
- `404` — Resource not found
- `429` — Insufficient quota for API route

---

[API](https://skmtc.dev/socket-dev/apis/socket.md) · [All operations](https://skmtc.dev/socket-dev/apis/socket/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/socket-dev/socket/revisions/bf994b75d33f/schema)
