---
title: "Update Key Lifecycle Rule"
method: PATCH
path: "/key_lifecycle_rules/{id}"
tags: ["key_lifecycle_rules", "Key Lifecycle Rules"]
---

# Update Key Lifecycle Rule

`PATCH /key_lifecycle_rules/{id}`

Update Key Lifecycle Rule

## Path parameters

- `id` integer, required

## Response `200`

The KeyLifecycleRules object.

- KeyLifecycleRuleEntity — KeyLifecycleRuleEntity model
  - `id` integer — Key Lifecycle Rule ID
  - `key_type` 'gpg' | 'ssh' | 'api' — Key type for which the rule will apply (gpg, ssh, or api).
  - `inactivity_days` integer — Number of days of inactivity before the rule applies.
  - `expiration_days` integer — Number of days after creation before an SSH key expires. Applies only to SSH keys.
  - `apply_to_all_workspaces` boolean — If true, a default-workspace rule also applies to keys in all workspaces.
  - `name` string — Key Lifecycle Rule name
  - `workspace_id` integer — Workspace ID. `0` means the default workspace.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `405` — Method Not Allowed
- `409` — Conflict
- `412` — Precondition Failed
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests

---

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