---
title: "Create new user"
method: POST
path: "/api/v2/users"
tags: ["Users"]
---

# Create new user

`POST /api/v2/users`

## Request body

- CodersdkCreateUserRequestWithOrgs
  - `email` string, email
  - `login_type` '' | 'password' | 'github' | 'oidc' | 'token' | 'none'
  - `name` string
  - `organization_ids` string[] — OrganizationIDs is a list of organization IDs that the user should be a member of.
  - `password` string
  - `roles` string[] — Roles is an optional list of site-level roles to assign at creation.
  - `service_account` boolean — Service accounts are admin-managed accounts that cannot login.
  - `user_status` 'active' | 'dormant' | 'suspended'
  - `username` string, required

## Response `201`

Created

- CodersdkUser
  - `avatar_url` string, uri
  - `created_at` string, date-time, required
  - `email` string, email, required
  - `has_ai_seat` boolean — HasAISeat intentionally omits omitempty so the API always includes the field, even when false.
  - `id` string, uuid, required
  - `is_service_account` boolean
  - `last_seen_at` string, date-time
  - `login_type` '' | 'password' | 'github' | 'oidc' | 'token' | 'none'
  - `name` string
  - `organization_ids` string[]
  - `roles` CodersdkSlimRole[]
    - `display_name` string
    - `name` string
    - `organization_id` string
  - `status` 'active' | 'dormant' | 'suspended'
  - `theme_preference` string — Deprecated: this value should be retrieved from `codersdk.UserPreferenceSettings` instead.
  - `updated_at` string, date-time
  - `username` string, required

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
