---
title: "Delete an SSH public key"
method: POST
path: "/v2/ssh-keys/delete"
tags: ["ssh-keys"]
---

# Delete an SSH public key

`POST /v2/ssh-keys/delete`

Deletes an SSH public key. Reports SSH_PUBLIC_KEY_IN_USE while the key is attached to a live rental, and SSH_PUBLIC_KEY_NOT_FOUND for a key that don't exist or the user doesn't control

## Request body

- object
  - `id` integer, required

## Response `200`

Successful response

- object
  - `id` integer, required

## Other responses

- `400` — Invalid input data
- `401` — Authorization not provided
- `403` — Insufficient access
- `500` — Internal server error

## Changes

- **2026-09-26** `6b22302ea98a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hyperbolic/apis/castle-api/changes/v2/ssh-keys/delete/post.md)

---

[API](https://skmtc.dev/hyperbolic/apis/castle-api.md) · [All operations](https://skmtc.dev/hyperbolic/apis/castle-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hyperbolic/apis/castle-api/revisions/6b22302ea98a?raw)
