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

# Update an API Key

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

Update the name, operation, or scoped teams of an existing API key.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateAPIKeyRequest
  - `name` string — Descriptive name for the key.
  - `team_ids` string[] — Optional list of teams the key can access. Omit or pass an empty array for organization-wide access.
  - `operation` 'read_render' | 'all' | 'admin'

## Response `200`

API key updated successfully

- object
  - `api_key` APIKey
    - `id` string, uuid, required — Unique API Key identifier.
    - `name` string, required — Human-readable name given to the API key.
    - `org_id` string, uuid, required — UUID of the organization.
    - `team_id` string, uuid, nullable — Optional UUID of the team.
    - `operation` 'read_render' | 'all' | 'admin', required — The scope of operations.
    - `created_at` string, date-time, required — Timestamp when the API Key was created.
    - `last_used_at` string, date-time, nullable — Timestamp when the API Key was last used. Null if never used.

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — API key not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/px0-ai/apis/px0-api.md) · [All operations](https://skmtc.net/px0-ai/apis/px0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/px0-ai/px0-api/revisions/3ed72443989d/schema)
