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

Update a user

Can also add or remove the user's groups and authorized apps. Set is_active to false to disable the user. An admin cannot disable their own account.

put
Authorizations
defguard_sessionstringRequired
Path parameters
usernamestringRequired

Name of the user.

Body
emailstringRequired
email_mfa_enabledbooleanRequired
enrolledbooleanRequired
first_namestringRequired
groupsstring[]Required
idinteger · int64Required
is_activebooleanRequired
is_adminbooleanRequired
last_namestringRequired
ldap_pass_requires_changebooleanRequired
mfa_enabledbooleanRequired
mfa_methodstring · enumRequiredPossible values:
namestringRequired
phonestring · nullableOptional
totp_enabledbooleanRequired
usernamestringRequired
Responses
200

User updated.

No content

put/api/v1/user/{username}
PUT /api/v1/user/{username} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 738

{
  "authorized_apps": [
    {
      "oauth2client_id": 1,
      "oauth2client_name": "text"
    }
  ],
  "devices": [
    {
      "configured": true,
      "created": "2026-01-01T00:00:00.000Z",
      "description": null,
      "device_type": "user",
      "id": 1,
      "name": "text",
      "user_id": 1,
      "wireguard_pubkey": "text",
      "networks": [
        {
          "device_wireguard_ips": [
            "text"
          ],
          "is_active": true,
          "last_connected_at": null,
          "last_connected_ip": null,
          "location_mfa_mode": "disabled",
          "network_gateway_ip": "text",
          "network_id": 1,
          "network_name": "text"
        }
      ]
    }
  ],
  "email": "text",
  "email_mfa_enabled": true,
  "enrolled": true,
  "first_name": "text",
  "groups": [
    "text"
  ],
  "id": 1,
  "is_active": true,
  "is_admin": true,
  "last_name": "text",
  "ldap_pass_requires_change": true,
  "mfa_enabled": true,
  "mfa_method": "None",
  "name": "text",
  "phone": null,
  "totp_enabled": true,
  "username": "text"
}

No content

Last updated

Was this helpful?