Employee Identity (EIAM)
Add User
API
# Permissions
The Identity Management API is authorized at the application level. Before calling the interface, you need to set interface permissions for different applications. For details, please refer to API Permissions.
| Permission Code | Description |
|---|---|
| user_all | Read and write permissions for user management interfaces |
| all | Read and write permissions for all interfaces |
# Request Description
POST https://{your_domain}/api/v2/tenant/users
# Request Headers
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| Authorization | Authorization | Yes | String | Format: Bearer {access_token} |
| Content-Type | Content Type | Yes | String | Fixed value: application/json; charset=utf-8 |
# Request Example 1 (Used when positions are not enabled)
{
"user_name": "cq04130004",
"org_code": "10000",
"name": "cq04130004",
"mobile": "+86-15204130004",
"email": "15204130004@example.com",
"employee_id": "04130004",
"external_id": "04130004",
"first_name": "F",
"middle_name": "M",
"last_name": "L",
"password": "P@ssw0rd",
"pwd_must_modify":false,
"attr_gender":"male",
"attr_birthday":"1993-08-25",
"attr_nick_name":"cq04130004",
"attr_manager_id": "20240531140530566-8F29-6EC1BBEF1",
"user_org_relation_list": [
{
"org_code": "10000",
"relation_type": 1
},
{
"org_code": "TestOrg1",
"relation_type": 0
},
{
"org_code": "TestOrg2",
"relation_type": 0
}
],
"extension": {
"age": "18"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Request Example 2 (Used after enabling positions)
{
"user_name": "cq04130004",
"org_code": "10000",
"name": "cq04130004",
"mobile": "+86-15204130004",
"email": "15204130004@example.com",
"employee_id": "04130004",
"external_id": "04130004",
"first_name": "F",
"middle_name": "M",
"last_name": "L",
"password": "P@ssw0rd",
"pwd_must_modify": false,
"attr_gender": "male",
"attr_birthday": "1993-08-25",
"attr_nick_name": "cq04130004",
"jobs": [
{
"org_code": "10000",
"position_code": "IDaaS_Java_Developer",
"title_code": "Senior_Engineer",
"relation_type": 1
},
{
"org_code": "TestOrg1",
"position_code": "TestOrg1_Java_Developer",
"title_code": "Senior_Engineer",
"relation_type": 0
},
{
"org_code": "TestOrg2",
"position_code": "TestOrg2_Java_Developer",
"title_code": "Senior_Engineer",
"relation_type": 0
}
],
"extension": {
"age": "18"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Whether the user_name, name, mobile, email, employee_id, external_id, first_name, middle_name, last_name, attr_gender, attr_birthday, attr_nick_name attributes are required can be configured in IDaaS Enterprise Center > User Attribute Definition.
# Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| user_name | Username | Yes | String | Username, unique within the system |
| org_code | Organization Code | No | String | When empty, defaults to under the first root organization |
| name | Full Name | No | String | Full Name |
| mobile | Mobile Number | Yes | String | Mobile number, unique within the system |
| No | String | Email, unique within the system | ||
| employee_id | Employee ID | No | String | Employee ID |
| external_id | External System ID | No | String | External System ID, unique within the system |
| password | Password | No | String | Password must meet the format defined by the enterprise |
| pwd_must_modify | Force Password Change | No | Boolean | true means password must be changed on first login, false means password does not need to be changed on first login |
| first_name | First Name | No | String | |
| middle_name | Middle Name | No | String | |
| last_name | Last Name | No | String | |
| attr_gender | Gender | No | String | Optional values: "unknow": Undisclosed "male": Male "female": Female |
| attr_birthday | Birthday | No | String | Format: yyyy-mm-dd |
| attr_nick_name | Nickname | No | String | |
| attr_manager_id | Direct Manager ID | No | String | Manager's user id |
| user_org_relation_list | User-Organization Relationship Collection | No | JSONArray | Used only when position management is not enabled, cannot coexist with jobs. org_code: Organization code; relation_type: 1 represents belonging, 0 represents affiliation |
| jobs | User's Position Information Collection | No | JSONArray | Used only after enabling position management, cannot coexist with user_org_relation_list. org_code: Organization code; position_code: Position code; title_code: Title code; relation_type: 1 represents primary position in the affiliated organization, 0 represents concurrent or part-time position |
| extension | Extended Attributes | No | JSONObject | Extended attributes, the extended attributes need to be defined in the enterprise |
# Response Example
Success Example:
HTTP/1.1 201 Created
Content-Type: application/json
{
"user_id": "20201028102749564-9082-DC8CD2722"
}
Error Example:
HTTP/1.1 400 Bad Request
{
"error_code": "ORG.0001",
"error_msg": "Organization does not exist"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| user_id | Created User's user_id | String | System-generated |
# Error Codes
| Status Code | Error Code | Error Message | Handling Action |
|---|---|---|---|
| 400 | ORG.0001 | Organization does not exist | Please check if the corresponding organization exists |
| Organization does not exist | |||
| 400 | ORG.0010 | Organization ID cannot be empty | Please check if the organization ID field in the input parameters is empty |
| Organization ID cannot be empty | |||
| 400 | JOB.POSITION.0001 | Position does not exist | Please check if the corresponding position exists |
| Position does not exist | |||
| 400 | JOB.TITLE.0001 | Job title does not exist | Please check if the corresponding job title exists |
| Job title does not exist | |||
| 400 | USER.0009 | Username cannot be empty | Please check if the username field in the input parameters is empty |
| Username cannot be empty | |||
| 400 | USER.0010 | Name cannot be empty | Please check if the name field in the input parameters is empty |
| Name cannot be empty | |||
| 400 | USER.0011 | Mobile number cannot be empty | Please check if the mobile number field in the input parameters is empty |
| Mobile number cannot be empty | |||
| 400 | USER.0012 | Email cannot be empty | Please check if the email field in the input parameters is empty |
| Email cannot be empty | |||
| 400 | USER.0013 | Name cannot be empty | Please check if the name field in the input parameters is empty |
| Name cannot be empty | |||
| 400 | USER.0014 | Middle name cannot be empty | Please check if the middle name field in the input parameters is empty |
| Middle name cannot be empty | |||
| 400 | USER.0015 | Last name cannot be empty | Please check if the last name field in the input parameters is empty |
| Last name cannot be empty | |||
| 400 | USER.0016 | Nickname cannot be empty | Please check if the nickname field in the input parameters is empty |
| Nickname cannot be empty | |||
| 400 | USER.0017 | Birthday cannot be empty | Please check if the birthday field in the input parameters is empty |
| Birthday cannot be empty | |||
| 400 | USER.0018 | Gender cannot be empty | Please check if the gender field in the input parameters is empty |
| Gender cannot be empty | |||
| 400 | USER.0019 | Identity type cannot be empty | Please check if the identity type field in the input parameters is empty |
| Identity type cannot be empty | |||
| 400 | USER.0020 | The ID number cannot be empty | Please check if the ID number field in the input parameters is empty |
| The ID number cannot be empty | |||
| 400 | USER.0021 | Country or area cannot be empty | Please check if the country or area field in the input parameters is empty |
| Country or area cannot be empty | |||
| 400 | USER.0022 | City cannot be empty | Please check if the city field in the input parameters is empty |
| City cannot be empty | |||
| 400 | USER.0023 | Employer ID cannot be empty | Please check if the employer ID field in the input parameters is empty |
| Employer ID cannot be empty | |||
| 400 | USER.0024 | The external system ID cannot be empty | Please check if the external system ID field in the input parameters is empty |
| The external system ID cannot be empty | |||
| 400 | USER.0025 | The direct superior cannot be empty | Please check if the direct superior field in the input parameters is empty |
| The direct superior cannot be empty | |||
| 400 | USER.0026 | Person type cannot be empty | Please check if the person type field in the input parameters is empty |
| Person type cannot be empty | |||
| 400 | USER.0027 | Hire date cannot be empty | Please check if the hire date field in the input parameters is empty |
| Hire date cannot be empty | |||
| 400 | USER.0028 | Work location cannot be empty | Please check if the work location field in the input parameters is empty |
| Work location cannot be empty | |||
| 400 | USER.0029 | Extension property [{0}] cannot be empty | Please check if the extension property [{0}] field in the input parameters is empty |
| Extension property [{0}] cannot be empty | |||
| 400 | USER.0030 | Username already exists | The current username already exists, please change to another non-existent value |
| Username already exists | |||
| 400 | USER.0031 | Mobile number already exists | The current mobile number already exists, please change to another non-existent value |
| Mobile number already exists | |||
| 400 | USER.0032 | Email already exists | The current email already exists, please change to another non-existent value |
| Email already exists | |||
| 400 | USER.0033 | The ID number already exists | The current ID number already exists, please change to another non-existent value |
| The ID number already exists | |||
| 400 | USER.0034 | The employee ID already exists | The current employee ID already exists, please change to another non-existent value |
| The employee ID already exists | |||
| 400 | USER.0035 | External System ID already exists | The current external attribute ID already exists, please change to another non-existent value |
| External System ID already exists | |||
| 400 | USER.0036 | Extension attribute [{0}] already exists | The current extension attribute [{0}] already exists, please change to another non-existent value |
| Extension attribute [{0}] already exists | |||
| 400 | USER.0037 | Username does not meet the verification rules | Please check if the username field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Username does not meet the verification rules | |||
| 400 | USER.0038 | Name does not meet verification rules | Please check if the name field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Name does not meet verification rules | |||
| 400 | USER.0039 | The mobile phone number does not meet the verification rules | Please check if the mobile number field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The mobile phone number does not meet the verification rules | |||
| 400 | USER.0040 | Email does not meet the verification rules | Please check if the email field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Email does not meet the verification rules | |||
| 400 | USER.0041 | The name does not meet the verification rules | Please check if the name field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The name does not meet the verification rules | |||
| 400 | USER.0042 | Middle name does not meet the verification rules | Please check if the middle name field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Middle name does not meet the verification rules | |||
| 400 | USER.0043 | Last name does not meet verification rules | Please check if the last name field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Last name does not meet verification rules | |||
| 400 | USER.0044 | Nickname does not meet the verification rules | Please check if the nickname field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Nickname does not meet the verification rules | |||
| 400 | USER.0045 | Birthday does not meet verification rules | Please check if the birthday field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Birthday does not meet verification rules | |||
| 400 | USER.0046 | Gender does not meet the verification rules | Please check if the gender field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Gender does not meet the verification rules | |||
| 400 | USER.0047 | The ID type does not meet the verification rules | Please check if the identity type field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The ID type does not meet the verification rules | |||
| 400 | USER.0048 | The ID number does not meet the verification rules | Please check if the ID number field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The ID number does not meet the verification rules | |||
| 400 | USER.0049 | Country or region does not meet verification rules | Please check if the country and region field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Country or region does not meet verification rules | |||
| 400 | USER.0050 | City does not meet verification rules | Please check if the city field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| City does not meet verification rules | |||
| 400 | USER.0051 | The employee ID does not meet the verification rules | Please check if the employee ID field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The employee ID does not meet the verification rules | |||
| 400 | USER.0052 | The external system ID does not meet the verification rules | Please check if the external system ID field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The external system ID does not meet the verification rules | |||
| 400 | USER.0053 | The immediate superior does not meet the verification rules | Please check if the direct superior field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The immediate superior does not meet the verification rules | |||
| 400 | USER.0054 | The person type does not meet the verification rules | Please check if the person type field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| The person type does not meet the verification rules | |||
| 400 | USER.0055 | Job date does not meet verification rules | Please check if the hire date field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Job date does not meet verification rules | |||
| 400 | USER.0056 | Work location does not meet verification rules | Please check if the work location field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Work location does not meet verification rules | |||
| 400 | USER.0057 | Extension property [{0}] does not meet verification rules | Please check if the extension property [{0}] field in the input parameters meets the verification rules in 【Enterprise Center - User - User Attribute Definition】 |
| Extension property [{0}] does not meet verification rules | |||
| 400 | USER.0080 | User cannot have more than {0} organizations | Please modify the number of organizations for the user in the input parameters |
| User cannot have more than {0} organizations | |||
| 400 | USER.0081 | Users can only have one primary organization | Please modify the number of primary organizations for the user in the input parameters |
| Users can only have one primary organization | |||
| 400 | USER.00811 | The user's main organization does not exist | Please check if there is data for the main organization in the parameters |
| The user's main organization does not exist | |||
| 400 | USER.0082 | The organization on the user must match the primary organization in the relationship | Please check if the organization on the user matches the primary organization in the user organization relationship parameters |
| The organization on the user must match the primary organization in the relationship | |||
| 400 | USER.0083 | Unsupported user organization relation type | Please check if the user organization relation type parameter in the input parameters is correct |
| Unsupported user organization relation type | |||
| 400 | USER.0085 | The number of users cannot exceed the specification limit | Please contact the administrator to upgrade the enterprise user specification quantity |
| The number of users cannot exceed the specification limit | |||
| 400 | USER.0094 | The organization in the user's employment information cannot be empty | Please fill in the organization in the position information |
| The organization in the user's employment information cannot be empty | |||
| 400 | USER.0095 | The position in the user's employment information cannot be empty | Please fill in the position in the position information |
| The position in the user's employment information cannot be empty | |||
| 400 | USER.0096 | The job title in the user's employment information cannot be empty | Please fill in the job title in the position information |
| The job title in the user's employment information cannot be empty | |||
| 400 | USER.0097 | The position in the user's job information is not under the selected organization | Please check if the position in the position information is under the corresponding organization |
| The position in the user's job information is not under the selected organization |
I understand. Please provide the Markdown content you need translated.
