---
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: an empty set would widen access to every org key (the org-wide fallback), 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.net/openrelay/apis/openrelay-api.md) · [All operations](https://skmtc.net/openrelay/apis/openrelay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrelay/openrelay-api/versions/32905b8f44f8/schema)
