For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add a device for a user

The device is added to every location. wireguard_pubkey has to be unique. Devices of disabled users can only be added by an admin.

post
Authorizations
defguard_sessionstringRequired
Path parameters
device_idstringRequired

Name of the user the device is created for.

Body
namestringRequired
wireguard_pubkeystringRequired
Responses
201

Device added.

application/json
post/api/v1/device/{device_id}
POST /api/v1/device/{device_id} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "name": "work laptop",
  "wireguard_pubkey": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg="
}
{
  "configs": [
    {
      "address": "0.0.0.0:8000",
      "allowed_ips": [
        "0.0.0.0:8000"
      ],
      "config": "config",
      "dns": "8.8.8.8",
      "endpoint": "endpoint",
      "keepalive_interval": 5,
      "location_mfa_mode": "disabled",
      "network_id": 0,
      "network_name": "network_name",
      "pubkey": "pubkey",
      "service_location_mode": "disabled"
    }
  ],
  "device": {
    "configured": true,
    "created": "2024-07-10T10:25:43.231",
    "description": null,
    "device_type": "user",
    "id": 1,
    "name": "work laptop",
    "user_id": 1,
    "wireguard_pubkey": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg="
  }
}

Last updated

Was this helpful?