Devices & VPN
Register a device to connect your computer to a sandbox's private network over WireGuard. Keep the WireGuard private key on your device; register only its public key.
Base URL: https://api.sb.createos.sh. All endpoints require X-Api-Key and are scoped to your account. JSON responses use JSend.
Register and manage a device
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/devices | Register a device. |
| GET | /v1/devices | List your devices. |
| GET | /v1/devices/{id} | Read a device. |
| DELETE | /v1/devices/{id} | Delete a device. |
Registration accepts:
| Field | Required | Description |
|---|---|---|
name | Yes | Device name, unique within your account. |
pubkey | Yes | Base64-encoded 32-byte WireGuard public key. |
hostname | No | Device hostname. |
os | No | Operating-system label. |
Use the returned device id for subsequent operations. Invalid keys return 400; duplicate names or public keys return 409. Account device limits also apply.
Attach a network
| Method | Path | Request |
|---|---|---|
| POST | /v1/devices/{id}/networks | { "network_id": "<network-id>" } |
| GET | /v1/devices/{id}/networks | List attached networks. |
| DELETE | /v1/devices/{id}/networks/{network_id} | Detach a network. |
Create the network through the Networks API and attach the sandboxes you need to reach. Attach the device to at least one network before starting a VPN session.
Connect, renew, and disconnect
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/devices/{id}/sessions | Create a session, or renew/reuse an active session. No request body required. |
| GET | /v1/devices/{id}/sessions | List active sessions. |
| PUT | /v1/devices/{id}/sessions/{session_id} | Renew an active session. No request body required. |
| DELETE | /v1/devices/{id}/sessions/{session_id} | End a session. |
Session creation returns session_id, device_id, relay_host_id, client_config, and expires_at. Use the returned WireGuard configuration with your locally held private key. Session listing and renewal return session metadata, without repeating client_config.
Renew before expires_at to keep the session active. A missing or expired session returns 404 on renewal; create a new session to reconnect. Session creation without an attached network returns 400. Connectivity also depends on regional VPN capacity and your device's WireGuard setup.