POST
/api/users/{userId}/approveApprove a user
Approves a user who is pending approval. Use the user's identifier to select the account to approve. The response contains the approved user object and its updated account state.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
userIdstringrequired
The unique identifier of the user to approve.
200Returns the approved 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
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 approve, and that user must be pending approval.