Add a device for a user
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
400
No networks are configured, or a device with this public key already exists.
application/json
401
Session is missing or invalid.
application/json
403
Requires admin privileges or the request must target your own account.
application/json
404
User not found.
application/json
500
Unable to add device.
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?