Creates a user
POST/v2/users
Creates an email account in the current organization. The request must provide user information such as the email address, display name, and an initial password that complies with the organization's security policy.
Request
Body parameters
- NORMAL: Normal
- FREEZE: Frozen
- EMPLOYEE: Employee
- CONTRACTOR: Contractor
- INTERN: Intern
- SERVICE: Shared account
- WORK_ACCOUNT: Work account
Specifies the email address to display; must be one of the alias list.
Password, only used for creating a user, not readable or writable.
User name (person name).
User nickname (or alias).
Default send email address (Optional field: returned when the $select=defaultSendEmail query parameter is added to the URL. Use commas to separate multiple fields.)
Employee ID.
Position.
Workplace.
Workstation.
Residence (Optional field: returned after adding the $select=homeLocation query parameter in the URL. Use commas to separate multiple fields).
List of departments the user belongs to, not the department chain. A user may belong to multiple departments simultaneously.
Phone number (Optional field: returned when the $select=phone query parameter is added to the URL. Use commas to separate multiple fields.)
Work phone number. (Optional field: returned when you add the $select=workPhone query parameter to the URL. To query multiple fields, separate them with commas.)
Account status (Normal or Frozen only). Only the domain administrator or an authorized application can modify it.
Possible values: [NORMAL, FREEZE]
Language preference (ISO 639-1 Code, e.g., zh_CN/zh_TW/en_US) (Optional field: returned by adding the $select=preferredLanguage query parameter in the URL; use commas to separate multiple fields).
Account status change reason. Only modifiable by the domain administrator or an authorized application. (Optional field: Returned by adding the $select=statusChangeReason query parameter in the URL. For multiple fields, use commas to separate.)
Custom display name, the name displayed when sending emails.
Manager email, writable (Optional field: returned when the $select=managerEmail query parameter is added to the URL. Use commas to separate multiple fields).
Last password modification time (Optional field: returned when the $select=lastPasswordChangeTime query parameter is added to the URL. Use commas to separate multiple fields.).
Whether to hide from the address book. Only the administrator or authorized applications can access it and modify it. (Optional field: return by adding the $select=isHidden query parameter in the URL. Use commas to separate multiple fields.)
Information notes. Only the domain administrator or authorized applications can access and modify this field. (Optional field: Returns after adding the $select=info query parameter to the URL. Use commas to separate multiple fields.)
Whether to force password change on next login. Only administrators or authorized applications can modify it. (Optional field: returned after adding the $select=forceChangePasswordNextSignIn query parameter in the URL. Use commas to separate multiple fields.)
Account type. (Optional field: returned when the $select=employeeType query parameter is added to the URL. For multiple fields, separate them with commas.)
Possible values: [EMPLOYEE, CONTRACTOR, INTERN, SERVICE, WORK_ACCOUNT]
Password expiration time. (Optional field: returned when the query parameter $select=passwordExpireTime is added to the URL. Separate multiple fields with commas.)
orderInDepartments object[]
Sort order of the account in different departments. The full set of department sort values must be provided. This field affects the account's sort order in other departments; in general, prefer using the API that sets the sort order for a single department. For example, if an account belongs to departments a, b, and c, and originally only had a sort value for department c, updating this field with sort values for departments a and b will result in the account having only sort values for departments a and b, and the original sort value for department c will be lost. Only accessible to administrators or authorized applications. This field is modifiable (Optional field: returned when the query parameter $select=orderInDepartments is added to the URL; use commas to separate multiple fields).
customFields object
Custom field values added by the user. Supports partial modification; you do not need to pass all field values. Can only be modified by the user, an administrator, or an authorized application. Can be read in full via $select=customFields. Otherwise, only the value of a public field can be read via $select=customFields.<fieldID>.
Custom field values added by the user. Supports partial modification; you do not need to pass all field values. Can only be modified by the user, an administrator, or an authorized application. Can be read in full via $select=customFields. Otherwise, only the value of a public field can be read via $select=customFields.<fieldID>.
Response
- NORMAL: Normal
- FREEZE: Frozen
- EMPLOYEE: Employee
- CONTRACTOR: Contractor
- INTERN: Intern
- SERVICE: Shared account
- WORK_ACCOUNT: Work account
User ID,
Specifies the email address to display; must be one of the alias list.
List of email address aliases.
User name (person name).
User nickname (or alias).
Default send email address (Optional field: returned when the $select=defaultSendEmail query parameter is added to the URL. Use commas to separate multiple fields.)
Employee ID.
Position.
Workplace.
Workstation.
Residence (Optional field: returned after adding the $select=homeLocation query parameter in the URL. Use commas to separate multiple fields).
List of departments the user belongs to, not the department chain. A user may belong to multiple departments simultaneously.
Phone number (Optional field: returned when the $select=phone query parameter is added to the URL. Use commas to separate multiple fields.)
Work phone number. (Optional field: returned when you add the $select=workPhone query parameter to the URL. To query multiple fields, separate them with commas.)
Account status (Normal or Frozen only). Only the domain administrator or an authorized application can modify it.
Possible values: [NORMAL, FREEZE]
avatar object
Avatar.
Avatar URL.
Background color value when the avatar URL is empty. Example: #0089ff.
Creation time.
Freeze time, readable by administrators or authorized applications (Optional field: returned when the query parameter $select=freezedTime is added to the URL; use commas to separate multiple fields).
Language preference (ISO 639-1 Code, e.g., zh_CN/zh_TW/en_US) (Optional field: returned by adding the $select=preferredLanguage query parameter in the URL; use commas to separate multiple fields).
Modification time.
Account status change reason. Only modifiable by the domain administrator or an authorized application. (Optional field: Returned by adding the $select=statusChangeReason query parameter in the URL. For multiple fields, use commas to separate.)
Custom display name, the name displayed when sending emails.
managerInfo object
Manager details (Optional field: returned after adding the query parameter $select=managerInfo in the URL. Use commas to separate multiple fields.)
Manager ID.
Supervisor email address.
Name.
Nickname.
Manager email, writable (Optional field: returned when the $select=managerEmail query parameter is added to the URL. Use commas to separate multiple fields).
departmentPath object
Department chain to which it belongs. If it belongs to multiple departments, multiple department chains are included (Optional field: returned after adding the $select=departmentPath query parameter in the URL. For multiple fields, separate them with commas).
paths object[]
Department chain.
Department node.
Indicates whether the dedicated password is enabled (Optional field: returned when the query parameter $select=enableClientPassword is added to the URL; use commas to separate multiple fields).
Last login time (Optional field: returned when the query parameter $select=lastLoginTime is included in the URL; use commas to separate multiple fields).
Last password modification time (Optional field: returned when the $select=lastPasswordChangeTime query parameter is added to the URL. Use commas to separate multiple fields.).
Whether it is the initial password (Optional field: returned after adding the $select=isInitialPassword query parameter to the URL. For multiple fields, separate them with commas).
Whether to hide from the address book. Only the administrator or authorized applications can access it and modify it. (Optional field: return by adding the $select=isHidden query parameter in the URL. Use commas to separate multiple fields.)
Last login IP address (Optional field: Returned after adding the $select=lastLoginIp query parameter in the URL. For multiple fields, use English commas as separators.)
Information notes. Only the domain administrator or authorized applications can access and modify this field. (Optional field: Returns after adding the $select=info query parameter to the URL. Use commas to separate multiple fields.)
Whether to force password change on next login. Only administrators or authorized applications can modify it. (Optional field: returned after adding the $select=forceChangePasswordNextSignIn query parameter in the URL. Use commas to separate multiple fields.)
Account type. (Optional field: returned when the $select=employeeType query parameter is added to the URL. For multiple fields, separate them with commas.)
Possible values: [EMPLOYEE, CONTRACTOR, INTERN, SERVICE, WORK_ACCOUNT]
Password expiration time. (Optional field: returned when the query parameter $select=passwordExpireTime is added to the URL. Separate multiple fields with commas.)
Last login time (standard protocol) (Optional field: returned when the $select=lastLoginTime4StandardProtocol query parameter is added to the URL. To request multiple fields, separate them with commas).
orderInDepartments object[]
Sort order of the account in different departments. The full set of department sort values must be provided. This field affects the account's sort order in other departments; in general, prefer using the API that sets the sort order for a single department. For example, if an account belongs to departments a, b, and c, and originally only had a sort value for department c, updating this field with sort values for departments a and b will result in the account having only sort values for departments a and b, and the original sort value for department c will be lost. Only accessible to administrators or authorized applications. This field is modifiable (Optional field: returned when the query parameter $select=orderInDepartments is added to the URL; use commas to separate multiple fields).
customFields object
Custom field values added by the user. Supports partial modification; you do not need to pass all field values. Can only be modified by the user, an administrator, or an authorized application. Can be read in full via $select=customFields. Otherwise, only the value of a public field can be read via $select=customFields.<fieldID>.
Custom field values added by the user. Supports partial modification; you do not need to pass all field values. Can only be modified by the user, an administrator, or an authorized application. Can be read in full via $select=customFields. Otherwise, only the value of a public field can be read via $select=customFields.<fieldID>.
Errors
400 | Bad Request |
401 | Access is unauthorized. Please check whether the correct authorization token is passed. |
403 | No API access permission. Please complete the relevant authorization on the application management page of the domain administrator. |
404 | Not Found |
409 | Conflict |
429 | Too Many Requests |