| dept_id | Number | Yes | 100 | The department ID. You can call the Get department list API to obtain the value of dept_id. |
| parent_id | Number | No | 2 | The parent department ID. The root department ID is 1. You can call the Get department list API to obtain the value of parent_id. |
| hide_dept | Boolean | No | true | Whether to hide this department: - true: hide the department. After being hidden, the department will not appear in the company contacts. - false: show the department. If no value is passed, the current setting remains unchanged. |
| dept_permits | String | No | 123,456 | The list of other departments that are allowed to view this department. This value takes effect when hide_dept is set to true. Note The total count of this list plus the user_permits list cannot exceed 50. |
| user_permits | String | No | user123,manager222 | The list of user IDs that are allowed to view this department. This value takes effect when hide_dept is set to true. Note The total count of this list plus the dept_permits list cannot exceed 50. |
| create_dept_group | Boolean | No | true | Whether to create an organization chat associated with this department. The default value is false, meaning that no chat is created. If no value is passed, the current setting remains unchanged. |
| order | Number | No | 10 | The sort value within the parent department. A smaller order value ranks higher. |
| name | String | No | HR | The department name. The length must be 1 to 64 characters. The characters ’-’, ’,’, and ’,’ are not allowed. |
| source_identifier | String | No | HR Department | The department identifier field. Developers can use this field to uniquely identify a department and map it to a department in external DingTalk contacts. Note This field is not visible in the department information in the organization management console. |
| outer_dept | Boolean | No | true | Whether to restrict members of this department from viewing the contacts: - true: enable the restriction. Once enabled, members of this department can only view contacts within the specified scope. - false: no restriction. If no value is passed, the current setting remains unchanged. |
| outer_permit_users | String | No | user123,manager123 | The list of user IDs in the contacts that members of this department are allowed to view. This parameter takes effect when outer_dept is set to true. Note The total count of this list plus the outer_permit_depts list cannot exceed 50. |
| outer_permit_depts | String | No | 123,456 | The list of department IDs in the contacts that members of this department are allowed to view. This parameter takes effect when outer_dept is set to true. Note The total count of this list plus the outer_permit_users list cannot exceed 50. |
| outer_dept_only_self | Boolean | No | true | Whether members of this department can only view the contacts of their own department and sub-departments: - true: can only view the contacts of their own department and sub-departments. - false: cannot view all contacts, and can only see themselves in the contacts. This parameter takes effect when outer_dept is set to true. If no value is passed, the current setting remains unchanged. |
| language | String | No | zh_CN | The contacts language: - zh_CN: Chinese. - en_US: English. |
| auto_add_user | Boolean | No | false | After the department chat has been created, whether new members joining the department are automatically added to the chat: - true: automatically join the chat. - false: do not automatically join the chat. If no value is passed, the current setting remains unchanged. |
| auto_approve_apply | Boolean | No | false | Whether to automatically approve requests to join this department: - true: requests to join this department are approved automatically. - false: requests to join this department must be approved by an admin with the relevant permissions. |
| dept_manager_userid_list | String | No | manager220 | The list of user IDs of the department managers. Separate multiple user IDs with commas. Note Department managers must be members of the current department. Otherwise, the API returns the error userId does not exist. |
| group_contain_sub_dept | Boolean | No | true | Whether the department chat includes sub-departments: - true: include. - false: do not include. If no value is passed, the current setting remains unchanged. |
| group_contain_outer_dept | Boolean | No | true | Whether the department chat includes outsourced departments: - true: include. - false: do not include. If no value is passed, the current setting remains unchanged. Note An outsourced department can only see its own department, and cannot see other departments or other people. |
| group_contain_hidden_dept | Boolean | No | true | Whether the department chat includes hidden departments: - true: include. - false: do not include. If no value is passed, the current setting remains unchanged. |
| org_dept_owner | String | No | 100 | The user ID of the organization chat owner. Note The group owner must be a member of the current department. |
| force_update_fields | String | No | dept_manager_userid_list | The fields to be force-updated. This supports clearing specified fields. Separate multiple fields with commas. The currently supported field is: dept_manager_userid_list. |
| code | String | No | 10000 | The department code. The maximum length is 30 characters. Note This field can only be set through this API. |