---
title: "Update a user API key"
method: PUT
path: "/api/v1/auth/keys/{id}"
tags: ["User API Keys"]
---

# Update a user API key

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

## Path parameters

- `id` string, uuid, required

## Request body

- UserApiKey
  - `expires_at` string, date-time, nullable — When this record stops being valid.
  - `is_enabled` boolean — Whether the key may still be used. Disabled keys are rejected.
  - `key` string, required — The stored key. Returned redacted except on creation and rotation.
  - `last_used` string, date-time, nullable, required — When this key was last used to authenticate.
  - `name` string, required — Human-facing name for this key.
  - `network_ids` string[] — Network IDs this key has access to (hydrated from junction table)
  - `organization_id` string, uuid, required — The organization that owns this record.
  - `permissions` 'Owner' | 'Admin' | 'Member' | 'Viewer'
  - `tags` string[], required — Tags assigned to this entity.
  - `user_id` string, uuid, required — User the key acts on behalf of.
  - `created_at` string, date-time, required — When this record was first created.
  - `id` string, uuid, required — Server-assigned unique identifier.
  - `updated_at` string, date-time, required — When this record was last modified.

## Response `200`

API key updated

- ApiResponseUserApiKey
  - `data` object — The result payload. Omitted on failure.
    - `expires_at` string, date-time, nullable — When this record stops being valid.
    - `is_enabled` boolean — Whether the key may still be used. Disabled keys are rejected.
    - `key` string, required — The stored key. Returned redacted except on creation and rotation.
    - `last_used` string, date-time, nullable, required — When this key was last used to authenticate.
    - `name` string, required — Human-facing name for this key.
    - `network_ids` string[] — Network IDs this key has access to (hydrated from junction table)
    - `organization_id` string, uuid, required — The organization that owns this record.
    - `permissions` 'Owner' | 'Admin' | 'Member' | 'Viewer'
    - `tags` string[], required — Tags assigned to this entity.
    - `user_id` string, uuid, required — User the key acts on behalf of.
    - `created_at` string, date-time, required — When this record was first created.
    - `id` string, uuid, required — Server-assigned unique identifier.
    - `updated_at` string, date-time, required — When this record was last modified.
  - `error` string, nullable — Human-readable failure message. Omitted on success.
  - `meta` ApiMeta, required — API metadata included in all responses
    - `api_version` integer, required — API version (integer, increments on breaking changes)
    - `server_version` string, required — Server version (semver)
  - `success` boolean, required — `true` when the request succeeded. `false` responses carry `error` instead of `data`.

## Other responses

- `403` — Not authorized to update this key
- `404` — API key not found

---

[API](https://skmtc.net/scanopy/apis/scanopy-api.md) · [All operations](https://skmtc.net/scanopy/apis/scanopy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scanopy/scanopy-api/versions/28e466341947/schema)
