---
title: "Update User Api Key"
method: PUT
path: "/agents/user/api-keys/{key_id}"
tags: ["agents"]
---

# Update User Api Key

`PUT /agents/user/api-keys/{key_id}`

## Request

- Base URL: `https://studio-api.meganova.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://studio-api.meganova.ai/agents/user/api-keys/{key_id}`
- Auth: OAuth 2
  - Password
  - Token URL: `auth/token`

Update a user API key.

## Path parameters

- `key_id` string, uuid, required

## Request body

- UserAPIKeyUpdate: Update an API key.
  - `display_name` string, nullable
  - `api_key` string, nullable
  - `usage_limit_tokens` integer, nullable
  - `is_active` boolean, nullable

## Response `200`

Successful Response

- UserAPIKeyResponse: API key response (without the actual key).
  - `provider` string, required
  - `display_name` string, nullable
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `api_key_prefix` string, nullable
  - `is_valid` boolean, required
  - `last_validated_at` string, date-time, nullable
  - `validation_error` string, nullable
  - `total_requests` integer, required
  - `total_tokens` integer, required
  - `usage_limit_tokens` integer, nullable
  - `is_active` boolean, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/meganova/apis/meganova-api.md) - [All operations](https://skmtc.dev/meganova/apis/meganova-api/llms.txt) - [OpenAPI document](https://skmtc.dev/meganova/apis/meganova-api/revisions/c683584f6060?raw)
