Users
Create new user
post/api/v2/users
Request body
emailstring email
login_type'' | 'password' | 'github' | 'oidc' | 'token' | 'none'
namestring
organization_idsstring[]
OrganizationIDs is a list of organization IDs that the user should be a member of.
passwordstring
rolesstring[]
Roles is an optional list of site-level roles to assign at creation.
service_accountboolean
Service accounts are admin-managed accounts that cannot login.
user_status'active' | 'dormant' | 'suspended'
usernamestring required
Response
Created
avatar_urlstring uri
created_atstring date-time required
emailstring email required
has_ai_seatboolean
HasAISeat intentionally omits omitempty so the API always includes the field, even when false.
idstring uuid required
is_service_accountboolean
last_seen_atstring date-time
login_type'' | 'password' | 'github' | 'oidc' | 'token' | 'none'
namestring
organization_idsstring[]
status'active' | 'dormant' | 'suspended'
theme_preferencestring
Deprecated: this value should be retrieved from codersdk.UserPreferenceSettings instead.
updated_atstring date-time
usernamestring required