# Create user **POST /api/users** Create a new user with the given data. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters ### Body: application/json (object) - **primaryPhone** (string(regex)) Primary phone number for the user. It should be unique across all users. - **primaryEmail** (string(regex)) Primary email address for the user. It should be unique across all users. - **username** (string(regex)) Username for the user. It should be unique across all users. - **password** (string) Plain text password for the user. - **passwordDigest** (string) In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The value should be generated with one of the supported algorithms. The algorithm can be specified using the `passwordAlgorithm` property. - **passwordAlgorithm** (string) The hash algorithm used for the password. It should be one of the supported algorithms: argon2, md5, sha1, sha256. Should the encryption algorithm differ from argon2, it will automatically be upgraded to argon2 upon the user's next sign-in. - **name** (string) - **avatar** (string(url) | null | string(empty)) - **customData** (object) arbitrary - **profile** (object) ## Responses ### 200 User data for the newly created user. #### Body: application/json (object) - **id** (string) - **username** (string | null) - **primaryEmail** (string | null) - **primaryPhone** (string | null) - **name** (string | null) - **avatar** (string | null) - **customData** (object) arbitrary - **identities** (object) - **lastSignInAt** (number | null) - **createdAt** (number) - **updatedAt** (number) - **profile** (object) - **applicationId** (string | null) - **isSuspended** (boolean) - **hasPassword** (boolean) - **ssoIdentities** (array[object]) ### 400 Bad Request ### 401 Unauthorized ### 403 Forbidden ### 404 Not Found ### 422 Unprocessable Content [Powered by Bump.sh](https://bump.sh)