---
title: "Create Connection"
method: POST
path: "/v1/connections"
tags: ["connections"]
---

# Create Connection

`POST /v1/connections`

Create a new connection (typically done by the WebSocket handler).

The machine must exist and belong to the authenticated organization.

## Headers

- `Idempotency-Key` string

## Request body

- ConnectionCreate — Schema for creating a connection
  - `websocket_id` string, required
  - `ip_address` string, nullable
  - `user_agent` string, nullable
  - `machine_id` string, uuid, required

## Response `201`

Successful Response

- ConnectionResponse — Connection response schema
  - `websocket_id` string, required
  - `ip_address` string, nullable
  - `user_agent` string, nullable
  - `id` string, uuid, required
  - `machine_id` string, uuid, required
  - `connected_at` string, date-time, required
  - `disconnected_at` string, date-time, nullable, required
  - `last_ping` string, date-time, required
  - `status` 'connected' | 'disconnected' | 'error', required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/cyberdesk-hq/apis/cyberdesk-cloud.md) · [All operations](https://skmtc.net/cyberdesk-hq/apis/cyberdesk-cloud/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cyberdesk-hq/cyberdesk-cloud/revisions/830d2f48963d/schema)
