---
title: "Detach an org SSH key from a VM"
method: DELETE
path: "/v1/vms/{id}/ssh-keys/{keyId}"
tags: ["VMs"]
---

# Detach an org SSH key from a VM

`DELETE /v1/vms/{id}/ssh-keys/{keyId}`

Removes the key from the VM's allowed set. Detaching a key that is not attached is a no-op (204). The last attached key cannot be detached: the guest would have no way in over SSH, so that returns 400.

## Path parameters

- `id` string, required
- `keyId` string, required

## Response `204`

Detached

## Other responses

- `400` — The request is invalid
- `401` — Missing or invalid API key
- `403` — API key lacks the required scope
- `404` — Resource not found
- `409` — The request conflicts with existing state

---

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