CreateUser - Create user

Updated at:

Creates a user.

Important

The new Qoder CN documentation site is now available. Content on this site may not reflect the latest product features and changes. Visit docs.qoder.cn for the latest product documentation.

Supported editions

Enterprise Dedicated Edition

Service endpoints

Get the service endpoint and replace {domain} in the API request syntax with your endpoint.

Authorization

Product

Resource

Permission

organization settings

user

read and write

Request syntax

POST https://{domain}/oapi/v1/platform/users

Request

Create user

curl -X 'POST' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/users' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "Doc Test User 11",
        "username": "doc-test11",
        "password": "password***",
        "email": "doc-test11@example.com",
        "nickName": "Nickname 11",
        "staffId": "123456",
        "sysDeptIds": ["ebeb5a64-c98c-478a-9d9d-513841da****"]
    }'

Request headers

x-yunxiao-token string (Required)

The access token. See Access token for details.

Example: pt-0fh3****0fbG_35af****0484.

Parameters

name string (required)

The display name.

username string (required)

The login name.

password string (required)

The password.

email string (optional)

The email address.

nickName string (optional)

The nickname.

staffId string (optional)

The employee ID.

sysDeptIds array[string] (optional)

The IDs of the user's departments. If this parameter is left empty, the user is added to the root department.

Response

Sample response

{
    "id": "0eddcebb-a9ed-45a9-8225-7d5eff68****",
    "username": "doc-test11",
    "name": "Doc Test User 11",
    "nickName": "Nickname 11",
    "email": "doc-test11@example.com",
    "staffId": "123456",
    "createdAt": "2025-06-13T03:15:09Z"
}

id string

The user ID.

username string

The login name.

name string

The display name.

nickName string

The nickname.

email string

The email address.

staffId string

The employee ID.

createdAt string

The creation time.

Error codes

For more information, see Error code center.