Updates user information
PATCH/v2/users/:id_or_email
Updates user information based on the user ID or email address. Read-only fields and immutable fields are not modified.
Request
Path parameters
- id:
- email:
Body parameters
- NORMAL: Normal
- FREEZE: Frozen
- EMPLOYEE: Employee
- CONTRACTOR: Contractor
- INTERN: Intern
- SERVICE: Shared account
- WORK_ACCOUNT: Work account
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
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 |