POST/api/users

Create a User

Creates a new service user or sends an invite to a regular user

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

5 body fields

User invite information

auto_groupsarray<string>required
Group IDs to auto-assign to peers registered by this user
emailstringoptional
User's Email to send invite to
is_service_userbooleanrequired
Is true if this user is a service user
namestringoptional
User's full name
rolestringrequired
User's NetBird account role

5 status codes
200A User object
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
400Bad Request
401Requires authentication
403Forbidden
500Internal Server Error

Error handling

A 400 is returned: Bad Request. A 401 is returned: Requires authentication. A 403 is returned: Forbidden. A 500 is returned: Internal Server Error.