Create User with Password


Create a user with default password, and add the user to an OU.

Request Format


POST https://{apigw-address}/app-portal-service/v2.3/user/createAndJoinViaPwd

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

orgId

Query

Required

String

OU ID. How to get orgId >>

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

name

Required

String

User name.

email

Required

String

The user’s email address.

password

Optional

String

User password. If specified, the password is the default password of the user. If not specified, a token to reset user password will be returned, and you can use Reset Password with Token API to reset user password.

domain

Optional

String

The domain name that has been registered in Application Portal. If you want to create a domain account, you need to specify a domain. If not, leave it empty to create a non-domain account.

nickName

Optional

String

The nickname of the user.

company

Optional

String

The company that the user works for.

department

Optional

String

The department that the user belongs to.

position

Optional

String

The position of the user.

Response Parameters


Name

Data Type

Description

userId

String

User ID.

token

String

The token to reset the user password. Only returned if the request parameter password is empty.

success

Boolean

Whether the user was created successfully. true means success, false means failure.

Error Codes


Error Code

Description

31400

Required parameters are missing, or the password does not match the OU password rules.

31403

The application does not have the permission “Create or delete user accounts in the OU”.

31404

The domain does not exist, or the OU does not acquire the application.

31408

The user name or email already exists.

31429

The time of resetting passwords reaches the limit.

Samples

Request Sample


url: /app-portal-service/v2.3/user/createAndJoinViaPwd?orgId=your_org_ID

method: POST

{
  "name": "your_user_name",
  "email": "your_user_email",
  "password": "your_user_password"
}

Return Sample


{
  "code": 0,
  "message": "",
  "data": {
    "userId": "your_user_id",
    "success": true
  }
}