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

# Rotate API Token

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

Rotate an API Token

This endpoint consumes 10 units of your quota.

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

## Path parameters

- `org_slug` string, required

## Request body

- object — The API Token identifier to rotate. Provide uuid (recommended), id, token, or hash. May provide uuid+hash together for validation.
  - `uuid` string, uuid — The stable group UUID of the API token to rotate
  - `id` string — The API token ID to rotate
  - `token` string
  - `hash` string

## Response `200`

The replacement API Token with its stable UUID, new token value, and hash

- object
  - `id` string, required — The database ID of the new API token
  - `group_uuid` string, uuid, required — The stable group UUID (unchanged after rotation)
  - `created_by` string, uuid, nullable, required — ID of the Socket user who created the API Token
  - `token` string, required
  - `hash` string, required

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