---
title: "Rotate an API key"
method: POST
path: "/v1/api-keys/{uuid}/rotate"
tags: ["API Keys"]
---

# Rotate an API key

`POST /v1/api-keys/{uuid}/rotate`

Rotate an API key's token. The old token is invalidated and the new full token is returned once — store it immediately. You may rotate your own key; rotating another member's key requires API-key management permission.

## Path parameters

- `uuid` string, uuid, required

## Response `200`

The API key was rotated. The new full token is returned once.

- object
  - `uuid` string, uuid — You receive the UUID for this API key.
  - `name` string — You receive the API key name.
  - `environment` string — You receive the environment for this key: `sandbox` or `prod`.
  - `role` string — You receive the role granted to this key.
  - `created_at` string, date-time — You receive the timestamp when the key was created.
  - `token` string — You receive the full API key token. Store it now — it is only returned once.
  - `note` string — You receive a reminder that the token is only shown once.

---

[API](https://skmtc.net/didit-protocol/apis/didit-credentials-api.md) · [All operations](https://skmtc.net/didit-protocol/apis/didit-credentials-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/didit-protocol/didit-credentials-api/versions/e4eddba66557/schema)
