---
title: "POST /api-key/update"
method: POST
path: "/api-key/update"
tags: ["Api-key"]
---

# POST /api-key/update

`POST /api-key/update`

Update an existing API key by ID

## Request body

- object
  - `configId` unknown
  - `keyId` string, required — The id of the Api Key
  - `userId` unknown
  - `name` unknown
  - `enabled` unknown
  - `remaining` unknown
  - `refillAmount` unknown
  - `refillInterval` unknown
  - `metadata` unknown
  - `expiresIn` string, required
  - `rateLimitEnabled` unknown
  - `rateLimitTimeWindow` unknown
  - `rateLimitMax` unknown
  - `permissions` string, required

## Response `200`

API key updated successfully

- object
  - `id` string, required — ID
  - `name` string, nullable — The name of the key
  - `start` string, nullable — Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.
  - `prefix` string, nullable — The API Key prefix. Stored as plain text.
  - `userId` string, required — The owner of the user id
  - `refillInterval` number, nullable — The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)
  - `refillAmount` number, nullable — The amount to refill
  - `lastRefillAt` string, date-time, nullable — The last refill date
  - `enabled` boolean, required — Sets if key is enabled or disabled
  - `rateLimitEnabled` boolean, required — Whether the key has rate limiting enabled
  - `rateLimitTimeWindow` number, nullable — The duration in milliseconds
  - `rateLimitMax` number, nullable — Maximum amount of requests allowed within a window
  - `requestCount` number, required — The number of requests made within the rate limit time window
  - `remaining` number, nullable — Remaining requests (every time api key is used this should updated and should be updated on refill as well)
  - `lastRequest` string, date-time, nullable — When last request occurred
  - `expiresAt` string, date-time, nullable — Expiry date of a key
  - `createdAt` string, date-time, required — created at
  - `updatedAt` string, date-time, required — updated at
  - `metadata` object, nullable — Extra metadata about the apiKey
  - `permissions` string, nullable — Permissions for the api key (stored as JSON string)

## Other responses

- `400` — Bad Request. Usually due to missing parameters, or invalid parameters.
- `401` — Unauthorized. Due to missing or invalid authentication.
- `403` — Forbidden. You do not have permission to access this resource or to perform this action.
- `404` — Not Found. The requested resource was not found.
- `429` — Too Many Requests. You have exceeded the rate limit. Try again later.
- `500` — Internal Server Error. This is a problem with the server that you cannot fix.

## Changes

- **2026-03-04** `298877d6a79a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/usekaneo/apis/kaneo-api/changes/api-key/update/post.md)

---

[API](https://skmtc.dev/usekaneo/apis/kaneo-api.md) · [All operations](https://skmtc.dev/usekaneo/apis/kaneo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/usekaneo/kaneo-api/revisions/298877d6a79a/schema)
