PUT/api/users/{userId}

Replace a user's account settings

Replaces a user's role, automatic peer-group assignments, and blocked state. Supply role, auto_groups, and is_blocked in the update body. The response includes the updated user object and its account status.

1 parameter · 3 body fields
userIdstringrequired
The unique identifier of the user whose information you are updating.

User fields to update. When a body is supplied, role, auto_groups, and is_blocked are required.

auto_groupsarray<string>required
Group IDs to auto-assign to peers registered by this user
is_blockedbooleanrequired
If set to true then user is blocked and can't use the system
rolestringrequired
User's NetBird account role

5 status codes
200Returns the updated user object, including the user's ID, email, name, role, automatic group assignments, status, blocked state, and approval state.
auto_groupsarray<string>required
Group IDs to auto-assign to peers registered by this user
emailstringrequired
User's email address
idstringrequired
User ID
idp_idstringoptional
Identity provider ID (connector ID) that the user authenticated with. Only populated for users with Dex-encoded user IDs.
is_blockedbooleanrequired
Is true if this user is blocked. Blocked users can't use the system
is_currentbooleanoptional
Is true if authenticated user is the same as this user
is_service_userbooleanoptional
Is true if this user is a service user
issuedstringoptional
How user was issued by API or Integration
last_loginstringoptional
Last time this user performed a login to the dashboard
namestringrequired
User's name from idp provider
passwordstringoptional
User's password. Only present when user is created (create user endpoint is called) and only when IdP supports user creation with password.
pending_approvalbooleanrequired
Is true if this user requires approval before being activated. Only applicable for users joining via domain matching when user_approval_required is enabled.
permissionsobjectoptional
rolestringrequired
User's NetBird account role
statusstringrequired
User's status
Allowed:activeinvitedblocked
400Returned when the request is invalid.
401Returned when the request lacks valid authentication.
403Returned when access to the requested operation is forbidden.
500Returned when the server encounters an internal error.

Error handling

A 400 is returned when the request is invalid; a 401 when authentication is missing or invalid; a 403 when access is forbidden; and a 500 when the server encounters an internal error. The userId path parameter identifies the user to update. When you send a body, role, auto_groups, and is_blocked are required.