---
title: "Attach a WebTTY key to a trusted workspace device"
method: POST
path: "/api/workspaces/{workspaceId}/enterprise/devices/{deviceKeyId}/webtty-key"
tags: ["workspaces"]
---

# Attach a WebTTY key to a trusted workspace device

`POST /api/workspaces/{workspaceId}/enterprise/devices/{deviceKeyId}/webtty-key`

## Request

- Base URL: `https://rstream.io`
- URL: `https://rstream.io/api/workspaces/{workspaceId}/enterprise/devices/{deviceKeyId}/webtty-key`
- Auth: HTTP bearer

## Path parameters

- `workspaceId` string, required
- `deviceKeyId` string, required

## Request body

- AttachWorkspaceDeviceWebTTYKeyParams
  - `webttyPublicKey` string, required
  - `webttyKeyId` string, required
  - `webttyKeyAlgorithm` 'webtty-x25519-hpke-v1' | 'webtty-p256-hkdf-sha256-aes-256-gcm-random-nonce-v1', required
  - `signedAt` string, date-time, required
  - `signature` string, required

## Response `200`

Successful response.

- AttachWorkspaceDeviceWebTTYKeyResponse
  - `ok` true, required

## Other responses

- `400`: Request validation failed.
- `401`: Authentication is required.
- `403`: The token is not authorized.
- `404`: Workspace or device not found.

---

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