Create User and Choose OU


Create users and assign to an OU.

Operation Permissions


You need to authorize the application with the “Create or delete user accounts in this OU” permission in Application Portal.

Request Format


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

Request Parameters (Query)


Name

Mandatory/Optional

Data Type

Description

orgId

Mandatory

String

OU ID

Request Parameters (Body)


Name

Mandatory/Optional

Data Type

Description

name

Mandatory

String

User name

domain

Mandatory

String

The account domain name that is registered in Application Portal - To create a domain account, specify a domain - To create a non-domain account, leave the parameter blank

email

Mandatory

String

User email

organizationId

Mandatory

String

The ID of OU to assign the user `How to get organizationId >></docs/api/en/2.4.0/api_faqs#id-orgid-orgid>`__

locale

Optional

String

Language code. Simplified Chinese as default

  • en_US for English

  • zh_CN for Simplified Chinese

  • es_ES for Spanish

  • ja_JP for Japanese

nickName

Optional

String

User nickname

Response Parameters


Name

Data Type

Description

userId

String

New User ID

Error Codes


Code

Description

31400

Possible causes: OU ID, user name, and email are required, or the application is invalid

31403

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

31404

OU or domain does not exist

Samples

Request Sample


url: https://{apigw-address}/app-portal-service/v2.3/user/createAndJoinOrg?orgId=oxxxxxxxxxxx

method: POST

requestBody:
{
  "organizationId": "organizationId1",
  "nickName": "nickName1",
  "domain": "domain1",
  "name": "name1",
  "locale": "zh_CN",
  "email": "email1"
}

Return Sample


{
    "code": 0,
    "message": "OK",
    "data": {
        "userId": "uxxxxxxxxxxxxxx"
    }
}