---
title: "Rotate Service Account Key"
method: POST
path: "/api/identity/{team_key}/service-accounts/{account_key}/rotate"
tags: ["identity"]
---

# Rotate Service Account Key

`POST /api/identity/{team_key}/service-accounts/{account_key}/rotate`

## Request

- Base URL: `https://api.superit.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.superit.ai/api/identity/{team_key}/service-accounts/{account_key}/rotate`
- Auth: HTTP bearer

Issue a second credential, leaving the existing one live.

The body is optional: rotating with no options is the common case and
should not require sending an empty object.

## Path parameters

- `account_key` string, required
- `team_key` string, required

## Request body

- RotateKeyBody: Request body for issuing an additional credential.
  - `expiresInDays` integer, nullable

## Response `200`

Successful Response

- IssuedCredential: A newly minted credential. ``token`` appears here and nowhere else — it is never persisted and never returned by any read endpoint, so this response is the only chance the caller has to store it.
  - `key` string, required
  - `token` string, required
  - `prefix` string, required
  - `expiresAt` string, date-time, nullable

## Other responses

- `400`: Invalid input
- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/superit/apis/super-it-api.md) - [All operations](https://skmtc.dev/superit/apis/super-it-api/llms.txt) - [OpenAPI document](https://skmtc.dev/superit/apis/super-it-api/revisions/4944d556c2bb?raw)
