---
title: "Get SSH key + VNC password (HIGH-RISK)"
method: GET
path: "/v1/machines/{machine_id}/connection"
tags: ["machines"]
---

# Get SSH key + VNC password (HIGH-RISK)

`GET /v1/machines/{machine_id}/connection`

Managed machines only. External machines return 409 INVALID_STATE because Coasty never issues SSH, VNC, WebSocket, or browser-debug credentials for caller-owned devices. For managed machines, returns plaintext credentials gated by `connection:read`; the response is `Cache-Control: no-store`. Store credentials in a secrets manager — Coasty cannot re-issue them; rotate by terminating + reprovisioning.

## Response `200`

Connection details.

- ConnectionDetailsFull
  - `machine_id` string, required
  - `public_ip` string, nullable
  - `ssh_port` integer, nullable
  - `ssh_username` string, nullable
  - `ssh_private_key_pem` string, nullable — ED25519 (Linux) or RSA (Windows) private key. HIGHLY SENSITIVE — store in a secrets manager.
  - `vnc_port` integer, nullable
  - `vnc_password` string, nullable
  - `websocket_port` integer, nullable
  - `websocket_url` string, nullable
  - `devtools_url` string, nullable
  - `vnc_url` string, nullable — When available, a signed, short-lived, INTERACTIVE noVNC desktop URL (targets /vnc.html?autoconnect=1). Open directly in a browser or iframe to view AND control the desktop — no IP/port/password needed. Null when not available for this machine (use public_ip + vnc_port + vnc_password instead). Expires (~1h); re-fetch from this endpoint to refresh.
  - `screen_width` integer, nullable — Actual desktop width, when reported by the machine.
  - `screen_height` integer, nullable — Actual desktop height, when reported by the machine.
  - `request_id` string, required

## Other responses

- `400` — Invalid request body or parameters.
- `401` — Missing, invalid, or revoked API key. Pass `X-API-Key: sk-coasty-live-...` (or test).
- `403` — API key lacks the required scope or tier-feature is unavailable on the caller's plan.
- `404` — Resource not found in this key's namespace.
- `409` — The resource state conflicts with this operation.
- `413` — The request body exceeds the endpoint limit.
- `422` — The JSON shape is valid but one or more values violate the endpoint contract.
- `429` — Rate or concurrency limit exceeded.
- `500` — Unexpected server error. Retry with exponential backoff.
- `502` — An upstream dependency returned an invalid response.
- `503` — A required service is temporarily unavailable.
- `504` — An upstream dependency timed out.

---

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