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

# Updates a specific API key.

`PUT /accessmanagement/api-key/{apiKeyId}`

## Request

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

This endpoint updates the details of a specific API key, enabling users to keep key names or scopes up to date without generating a new key.</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>- **Reliable API key updates:** Facilitates the modification of a specific API key, ensuring accurate and up-to-date information across the system.</br>- **Targeted data update:** Leverages the `apiKeyId` parameter in the URL path to update the specified API key, ensuring accurate and focused modifications.

## Path parameters

- `apiKeyId` string, required

## Request body

- ApiKeyUpdateRequest
  - `id` string
  - `name` string
  - `note` string, nullable
  - `status` 'ACTIVE' | 'DISABLED' | 'EXPIRED'
  - `type` 'USER' | 'SERVICE'
  - `roles` ApiKeyUpdateRequestRoles[]: Optional field for Service Keys only to assign roles
    - `id` integer: Role Ids to Assign to the Service Key
  - `userGroups` ApiKeyUpdateRequestUserGroups[]: Optional field for Service Keys only to assign user groups
    - `id` integer: User Group Ids to Assign to the Service Key

## Response `200`

API key updated successfully.

- ApiKeyResponse
  - `id` string
  - `name` string
  - `username` string
  - `userId` string
  - `keySuffix` string
  - `expirationDate` string, date-time, nullable
  - `note` string, nullable
  - `status` 'ACTIVE' | 'DISABLED' | 'EXPIRED'
  - `type` 'USER' | 'SERVICE'
  - `lastUsedTs` string, date-time
  - `createdTs` string, date-time
  - `modifiedTs` string, date-time
  - `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)
