---
title: "Rotates a specific API key."
method: POST
path: "/accessmanagement/api-key/{apiKeyId}/rotate"
tags: ["accessmanagement - api keys"]
---

# Rotates a specific API key.

`POST /accessmanagement/api-key/{apiKeyId}/rotate`

## Request

- Base URL: `https://manager.digicertdns.com/v1`
- URL: `https://manager.digicertdns.com/v1/accessmanagement/api-key/{apiKeyId}/rotate`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/digicert/apis/digicert-dns/docs/accessmanagement/api-key/:apiKeyId/rotate/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint rotates a specific API key, allowing users to enhance security by replacing a key without changing its associated permissions or integrations.</br></br>Key features include:</br></br>- **Clear success messaging:** Returns a `200` success code with a confirmation message indicating the successful completion of the requested action.</br>- **Comprehensive error handling:** Returns `400` and `404` error codes with clear descriptions when requests fail.</br>- **Targeted API key rotation:** Leverages the `apiKeyId` parameter in the URL path to securely rotate a specific API key in-line with existing configurations, ensuring minimal disruption and improved credential hygiene.

## Path parameters

- `apiKeyId` string, required

## Request body

- ApiKeyRotateRequest
  - `id` string
  - `name` string, required
  - `note` string, nullable
  - `expire` boolean, required
  - `expirationDate` string, date-time, nullable

## Response `200`

API key rotated successfully.

- ApiKeyCreateResponse
  - `id` string
  - `name` string
  - `apiKey` string
  - `expirationDate` string, date-time, nullable
  - `expire` boolean
  - `note` string, nullable
  - `status` 'ACTIVE' | 'DISABLED' | 'EXPIRED'
  - `lastUsedTs` string, date-time
  - `createdTs` string, date-time
  - `modifiedTs` string, date-time
  - `type` 'USER' | 'SERVICE'
  - `roles` ServiceKeyResponseFieldsRoles[]
    - `id` integer
    - `name` string
    - `description` string
  - `resourceGroups` ServiceKeyResponseFieldsResourceGroups[]
    - `id` integer
    - `name` string
    - `description` string
    - `isDefault` boolean
  - `userGroups` ServiceKeyResponseFieldsUserGroups[]
    - `id` integer
    - `name` string
    - `description` string
    - `isDefault` boolean

## Other responses

- `400`: Request is malformed or invalid.
- `404`: Resource not found.

---

[API](https://skmtc.dev/digicert/apis/digicert-dns.md) - [All operations](https://skmtc.dev/digicert/apis/digicert-dns/llms.txt) - [OpenAPI document](https://skmtc.dev/digicert/apis/digicert-dns/revisions/c74fc728cff8?raw)
