---
title: "Create User"
method: POST
path: "/users/create"
tags: ["Identity"]
---

# Create User

`POST /users/create`

Creates an user within a CoreStack account and assign different roles for different tenants. There can be multiple tenants within a CoreStack account. User will be created at the account level and mapped to multiple tenants as needed.

## Request body

- UserCreateRequest
  - `username` string, required — The unique username for the user to be created. This value is expected to be unique across all accounts. Hence it is recommended that you use the email address as the value here. Validations:- Min length - 5, Alphanumeric
  - `email` string, required — Email ID of the user. This wil be unique across all the CoreStack accounts
  - `timezone_id` string, required — ID of the timezone to be set for th user. For a valid list of timezone values to use, please refer https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  - `account_id` string, required — ID of the Account in CoreStack. It will be available in the authToken API response
  - `first_name` string — First Name of the user. It can be only alphanumeric
  - `last_name` string — Last Name of the user. It can be only alphanumeric
  - `role_assignment` AddRoleAssignment[], required — List of roles assignments for the user. The same user can be assigned different roles in different tenants
    - `tenant_id` string, required — ID of the tenant within the CoreStack account
    - `role_names` string[], required — Name of the Roles to be assigned to the user under a tenant
  - `is_accesskey_required` boolean — Is Access Key to be generated for this user

## Response `201`

Success

- UserCreateResponse
  - `user_id` string, required — ID of the newly created User

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.dev/corestack/apis/corestack-external-api.md) · [All operations](https://skmtc.dev/corestack/apis/corestack-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corestack/corestack-external-api/revisions/bf2cdf20826d/schema)
