---
title: "Update an API key"
method: PUT
path: "/admin/api-keys/{id}"
tags: ["Admin API Keys"]
---

# Update an API key

`PUT /admin/api-keys/{id}`

## Path parameters

- `id` string, required

## Request body

- UpdateApiKeyDtoClass
  - `name` string — Name for the API key
  - `description` string — Description of the API key purpose
  - `isActive` boolean — Whether the key is active
  - `expiresAt` string — Expiration date in ISO format, or null to remove

## Response `200`

- ApiKeyItemDto
  - `id` string, required — Unique identifier
  - `name` string, required — Name of the API key
  - `description` string — Description
  - `keyPrefix` string, required — Key prefix for identification (first 8 chars)
  - `isActive` boolean, required — Whether the key is active
  - `lastUsedAt` string — Last time the key was used
  - `expiresAt` string — Expiration date
  - `createdAt` string, required — Creation timestamp
  - `updatedAt` string, required — Update timestamp

---

[API](https://skmtc.dev/miaai/apis/backend-template-api.md) · [All operations](https://skmtc.dev/miaai/apis/backend-template-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/miaai/backend-template-api/revisions/2a8d88a5124f/schema)
