# Obtain the list of users directly under a department

Call this interface to obtain the user information list directly under the specified department. User information includes user ID, name, email, mobile phone number, status and other information.

## Precautions

- When calling this interface using user identity (user_access_token), the interface will filter based on the visible range of the user's organizational structure and only return user data within the visible range of the organizational structure.
- When calling this interface using the application identity (tenant_access_token), the interface will be filtered according to the application's address book permission range. If the requested department ID is 0 (that is, the root department), the interface will verify whether the application has the address book permissions of all employees; if the requested department ID is a non-0 department ID, the interface will verify whether the application has the address book permissions of the department. . If there is no permission, the interface will return an error message without permission; if there is permission, it will return the list of direct users under the corresponding department.
- When calling this interface using application identity (tenant_access_token), the department path field (department_path) will not be returned in the response result. If you need to obtain the value of the department path field, please apply for the **Obtain member's department path (contact:user.department_path:readonly)** API permission for the application and call the interface using user identity (user_access_token).

For more information about the visible scope of the user's organizational structure and the scope of address book permissions, see [Authority Scope Resource Introduction](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority).

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/contact/v3/users/find_by_department
HTTP Method | GET
Rate Limit | [1000 per minute & 50 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.**<br>Enable any scope from the list | Get basic information in contacts(contact:contact.base:readonly)<br>Obtain department's organizational structure in contacts(contact:department.organize:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user's basic information(contact:user.base:readonly)<br>Obtain user's organization information(contact:user.department:readonly)<br>Obtain member's department path(contact:user.department_path:readonly)<br>View member's dotted-line leader ID(contact:user.dotted_line_leader_info.read)<br>Obtain user's employment information(contact:user.employee:readonly)<br>View member's Employee Number(contact:user.employee_number:read)<br>Obtain user's gender(contact:user.gender:readonly)<br>Obtain user's email information(contact:user.email:readonly)<br>Obtain user's mobile number(contact:user.phone:readonly)<br>Obtain user ID(contact:user.employee_id:readonly)<br>View member's geo location(contact:user.user_geo)<br>View user's job level(contact:user.job_level:readonly)<br>View user's job family(contact:user.job_family:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>or<br>`user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)
department_id_type | string | No | The type of department ID used in this call. For a detailed introduction to department ID, please refer to [Department ID Description](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0).<br>**Example value**: open_department_id<br>**Optional values are**:<br>- department_id：Supports user-defined configured department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.<br>- open_department_id：Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.<br>**Default value**: `open_department_id`
department_id | string | Yes | Department ID, ID type is consistent with the value of department_id_type.<br>**Note**:<br>- The root department has a department ID of 0.<br>- You can call the [Search Department](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/search) interface to obtain the corresponding department ID through the department name keyword.<br>**Example value**: od-xxxxxxxxxxxxx
page_size | int | No | Paging size, that is, the maximum number of entries in the user information list returned by this request.<br>**Example value**: 10<br>**Default value**: `10`<br>**Data validation rules**:<br>- Maximum value: `50`
page_token | string | No | Page identifier. It is not filled in the first request, indicating traversal from the beginning; when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups<br>**Example value**: AQD9/Rn9eij9Pm39ED40/dk53s4Ebp882DYfFaPFbz00L4CMZJrqGdzNyc8BcZtDbwVUvRmQTvyMYicnGWrde9X56TgdBuS+JKiSIkdexPw<br>contact.v3.type.user.prop.city.desc=$$$City

**Go Request Example**
```go
import (
	"context"

"github.com/larksuite/oapi-sdk-go/v3"
	"github.com/larksuite/oapi-sdk-go/v3/service/contact/v3"
)

func main() {
	client := lark.NewClient("appID", "appSecret")

req := larkcontact.NewFindByDepartmentUserReqBuilder().
		UserIdType(`open_id`).
		DepartmentIdType(`open_department_id`).
		DepartmentId(`od-xxxxxxxxxxxxx`).
		PageSize(10).
		Build()

resp, err := client.Contact.User.FindByDepartment(context.Background(), req)
}
```

**Java Request Example**
```java
import com.lark.oapi.Client;
import com.lark.oapi.service.contact.v3.model.*;
import com.lark.oapi.core.request.RequestOptions;

public class Main {
    public static void main(String arg[]) throws Exception {
        Client client = Client.newBuilder("appId", "appSecret").build();

FindByDepartmentUserReq req = FindByDepartmentUserReq.newBuilder()
                .userIdType("open_id")
                .departmentIdType("open_department_id")
                .departmentId("od-xxxxxxxxxxxxx")
                .pageSize(10)
                .build();

FindByDepartmentUserResp resp = client.contact().user().findByDepartment(req, RequestOptions.newBuilder().build());
    }
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
has_more | boolean | Whether the response body has more parameters
page_token | string | Page identifier, when has_more is true, a new page_token will also be returned. Otherwise, page_token will not be returned
items | user\[\] | User information list
union_id | string | User's union_id. For information about different IDs, see [User-related IDs](https://open.feishu.cn/document/home/user-identity-introduction/introduction).
user_id | string | Unique identifier of the user in the tenant, namely the user's user_id. For information of different IDs, refer to [User-related IDs](https://open.feishu.cn/document/home/user-identity-introduction/introduction).<br>**Required field scopes**:<br>Obtain user ID(contact:user.employee_id:readonly)
open_id | string | User's open_id. For information about different IDs, see [User-related IDs](https://open.feishu.cn/document/home/user-identity-introduction/introduction).
name | string | User name<br>**Required field scopes (Satisfy any)**:<br>Obtain user's basic information(contact:user.base:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
en_name | string | English name<br>**Required field scopes (Satisfy any)**:<br>Obtain user's basic information(contact:user.base:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
nickname | string | Alias<br>**Required field scopes (Satisfy any)**:<br>Obtain user's basic information(contact:user.base:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
email | string | Email Address.<br>**Required field scopes**:<br>Obtain user's email information(contact:user.email:readonly)
mobile | string | Mobile number<br>**Required field scopes**:<br>Obtain user's mobile number(contact:user.phone:readonly)
mobile_visible | boolean | Whether the mobile phone number is visible.<br>**Possible values are**:<br>- true: visible.<br>- false: invisible. When invisible, employees within the enterprise will not be able to view the user's mobile phone number.
gender | int | Gender<br>**Optional values are**:<br>- 0：Unknown<br>- 1：Male<br>- 2：Female<br>- 3：Other<br>**Required field scopes (Satisfy any)**:<br>Obtain user's gender(contact:user.gender:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
avatar_key | string | The file key of the avatar. This parameter actually has no return value, please ignore it. To obtain the avatar information, use the `avatar` parameter.
avatar | avatar_info | User's profile photo<br>**Required field scopes (Satisfy any)**:<br>Obtain user's basic information(contact:user.base:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
avatar_72 | string | Link of profile photo in 72*72 px
avatar_240 | string | Link of profile photo in 240*240 px
avatar_640 | string | Link of profile photo in 640*640 px
avatar_origin | string | Link of the original profile photo
status | user_status | user status. Displayed through is_frozen, is_resigned, is_activated, is_exited Boolean type parameters.<br>The transition logic of user status can be found in [User Resource Introduction](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/field-overview#4302b5a1).<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
is_frozen | boolean | Whether the user is frozen.<br>**Possible values are**:<br>- true<br>- false
is_resigned | boolean | Whether the user is terminated.<br>**Possible values are**:<br>- true<br>- false
is_activated | boolean | Whether the user is activated.<br>**Possible values are**:<br>- true<br>- false
is_exited | boolean | Whether the user is voluntary. The user's status will be automatically changed to terminated after the user has left for a specific time of period.<br>**Possible values are**:<br>- true<br>- false
is_unjoin | boolean | Whether the user has not joined. The user must confirm in person to join the team.<br>**Possible values are**:<br>- true<br>- false
department_ids | string\[\] | List of IDs of the departments to which the user belongs. A user can belong to multiple departments. The type of the ID value is consistent with the department_id_type value in the query parameter.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's organization information(contact:user.department:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
leader_user_id | string | The user ID of the user's direct supervisor. The type of the ID value is consistent with the user_id_type value in the query parameter.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's organization information(contact:user.department:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
city | string | work city<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
country | string | Country or region code. Refer to the [list of country/region codes](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/country-code-description) for details.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
work_station | string | Seat ID<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
join_time | int | Entry time, in timestamp format, in seconds since January 1, 1970<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
is_tenant_manager | boolean | Whether the user is a super administrator of the tenant.<br>**Possible values are**:<br>- true<br>- false<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
employee_no | string | Employee ID<br>**Required field scopes (Satisfy any)**:<br>View member's Employee Number(contact:user.employee_number:read)<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
employee_type | int | Employee type. Optional values are:<br>- `1`: Regular<br>- `2`: Intern<br>- `3`: Outsourcing<br>- `4`: Contractor<br>- `5`: Consultant   <br>The int value of the custom employee type can also be read, and the name of the custom employee type for the tenant can be obtained through the API:   <br>[Obtain workforce type](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/employee_type_enum/list)<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
orders | user_order\[\] | User sorting information . Indicating the order of personnel in the organizational structure. Personnel may exist in multiple departments and have different orders.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's organization information(contact:user.department:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
department_id | string | The department ID corresponding to the sorting information indicates the department where the user is located and needs to be sorted. The ID type is consistent with the value of department_id_type in the query parameter.
user_order | int | The user's ranking in their direct department. A larger value indicates a higher ranking.
department_order | int | Ranking of the user's departments. A larger value indicates a higher ranking.
is_primary_dept | boolean | Identifies whether the user's unique primary department. The main department is the department ranked first among the departments to which the user belongs (department_order is the largest).<br>**Possible values are**:<br>- true<br>- false
custom_attrs | user_custom_attr\[\] | Custom fields. To learn about custom fields, please see [Introduction to Custom Field Resources](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/custom_attr/overview).<br>**Note**: This field will only take effect when the enterprise administrator configures a custom field in the management background and turns on the **Allow Open Platform API Call** function.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
type | string | Custom field type   <br>- `TEXT`: Text<br>- `HREF`: Webpage<br>- `ENUMERATION`: Enumeration<br>- `PICTURE_ENUM`: Image<br>- `GENERIC_USER`: User
id | string | Custom field ID
value | user_custom_attr_value | Custom field value
text | string | - When the field type is TEXT, this parameter returns the defined field value.<br>- When the field type is HREF, this parameter returns the defined web page title.
url | string | When the field type is HREF, this parameter defines the default URL. , such as mobile phone jump to applet, PC jump to webpage .
pc_url | string | When the field type is HREF, this parameter defines URL on the PC.
option_id | string | When the field type is ENUMERATION or PICTURE_ENUM, this parameter returns the defined option ID.
option_value | string | The option value of the option in the enumeration type.
name | string | The name of the picture option in the picture type.
picture_url | string | Link to the picture option in the picture type.
generic_user | custom_attr_generic_user | When the field type is GENERIC_USER, this parameter returns the defined referrer information.
id | string | The user ID of the referrer. The ID type is consistent with the query parameter user_id_type.
type | int | user type. Currently fixed at 1, indicating the user type.
enterprise_email | string | Business email.<br>**Note**: This parameter will only take effect after the enterprise administrator enables the Feishu email service in the management background.<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
job_title | string | Job title<br>**Required field scopes (Satisfy any)**:<br>Obtain user's employment information(contact:user.employee:readonly)<br>Access Contacts as an app(contact:contact:access_as_app)<br>Read contacts(contact:contact:readonly)<br>Read Contacts as an app(contact:contact:readonly_as_app)
is_frozen | boolean | Whether to freeze the user.<br>**Possible values are**:<br>- true<br>- false
geo | string | geo<br>**Required field scopes**:<br>View member's geo location(contact:user.user_geo)
job_level_id | string | Job level ID<br>**Required field scopes**:<br>View user's job level(contact:user.job_level:readonly)
job_family_id | string | Job family ID<br>**Required field scopes**:<br>View user's job family(contact:user.job_family:readonly)
department_path | department_detail\[\] | Department path<br>**Note**: When calling this interface using application identity (tenant_access_token), the department path field (department_path) will not be returned in the response result. If you need to obtain the value of the department path field, please apply for the **Obtain member's department path (contact:user.department_path:readonly)** API permission for the application and call the interface using user identity (user_access_token).<br>**Required field scopes**:<br>Obtain member's department path(contact:user.department_path:readonly)
department_id | string | Department ID. The ID type is consistent with the value of the query parameter department_id_type.
department_name | department_path_name | Department name information.
name | string | Department name
i18n_name | department_i18n_name | Department international name
zh_cn | string | Chinese name of the department
ja_jp | string | Japanese name of the department
en_us | string | English name of the department
department_path | department_path | Department path
department_ids | string\[\] | Department Path IDs
department_path_name | department_path_name | Department path name
name | string | Department name
i18n_name | department_i18n_name | Department international name
zh_cn | string | Chinese name of the department
ja_jp | string | Japanese name of the department
en_us | string | English name of the department
dotted_line_leader_user_ids | string\[\] | The user ID of the dotted superior. The ID type is consistent with the value of the query parameter user_id_type.<br>**Required field scopes**:<br>View member's dotted-line leader ID(contact:user.dotted_line_leader_info.read)

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "has_more": true,
        "page_token": "AQD9/Rn9eij9Pm39ED40/RD/cIFmu77WxpxPB/2oHfQLZ%2BG8JG6tK7%2BZnHiT7COhD2hMSICh/eBl7cpzU6JEC3J7COKNe4jrQ8ExwBCR",
        "items": [
            {
                "union_id": "on_94a1ee5551019f18cd73d9f111898cf2",
                "user_id": "3e3cf96b",
                "open_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62",
                "name": "John",
                "en_name": "San Zhang",
                "nickname": "Alex Zhang",
                "email": "Alex@gmail.com",
                "mobile": "13011111111",
                "mobile_visible": false,
                "gender": 1,
                "avatar_key": "2500c7a9-5fff-4d9a-a2de-3d59614ae28g",
                "avatar": {
                    "avatar_72": "https://foo.icon.com/xxxx",
                    "avatar_240": "https://foo.icon.com/xxxx",
                    "avatar_640": "https://foo.icon.com/xxxx",
                    "avatar_origin": "https://foo.icon.com/xxxx"
                },
                "status": {
                    "is_frozen": false,
                    "is_resigned": false,
                    "is_activated": true,
                    "is_exited": false,
                    "is_unjoin": false
                },
                "department_ids": [
                    "od-4e6ac4d14bcd5071a37a39de902c7141"
                ],
                "leader_user_id": "ou_7dab8a3d3cdcc9da365777c7ad535d62",
                "city": "Hangzhou",
                "country": "CN",
                "work_station": "North building-H34",
                "join_time": 2147483647,
                "is_tenant_manager": false,
                "employee_no": "1",
                "employee_type": 1,
                "orders": [
                    {
                        "department_id": "od-4e6ac4d14bcd5071a37a39de902c7141",
                        "user_order": 100,
                        "department_order": 100,
                        "is_primary_dept": true
                    }
                ],
                "custom_attrs": [
                    {
                        "type": "TEXT",
                        "id": "DemoId",
                        "value": {
                            "text": "DemoText",
                            "url": "http://www.fs.cn",
                            "pc_url": "http://www.fs.cn",
                            "option_id": "edcvfrtg",
                            "option_value": "option",
                            "name": "name",
                            "picture_url": "https://xxxxxxxxxxxxxxxxxx",
                            "generic_user": {
                                "id": "9b2fabg5",
                                "type": 1
                            }
                        }
                    }
                ],
                "enterprise_email": "demo@mail.com",
                "job_title": "xxxxx",
                "is_frozen": false,
                "geo": "cn",
                "job_level_id": "mga5oa8ayjlp9rb",
                "job_family_id": "mga5oa8ayjlp9rb",
                "department_path": [
                    {
                        "department_id": "od-4e6ac4d14bcd5071a37a39de902c7141",
                        "department_name": {
                            "name": "测试部门名1",
                            "i18n_name": {
                                "zh_cn": "Test department name 1",
                                "ja_jp": "Deployment name 1",
                                "en_us": "Testing department name 1"
                            }
                        },
                        "department_path": {
                            "department_ids": [
                                "od-4e6ac4d14bcd5071a37a39de902c7141"
                            ],
                            "department_path_name": {
                                "name": "测试部门名1",
                                "i18n_name": {
                                    "zh_cn": "Test department name 1",
                                    "ja_jp": "Deployment name 1",
                                    "en_us": "Testing department name 1"
                                }
                            }
                        }
                    }
                ],
                "dotted_line_leader_user_ids": [
                    "ou_7dab8a3d3cdcc9da365777c7ad535d62"
                ]
            }
        ]
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 41050 | no user authority error | No user permissions. The current user needs to be added to the application or user's permission scope. Depending on the identity of the API caller, the solution is different, as follows:<br>- **Use tenant_access_token to call the API**<br>The current user needs to be added to the application's contacts permission scope. The contacts permission scope defines the data scope of departments and users that the application can obtain when calling the contacts API. The application cannot access data that is not within the contacts permission scope.<br>The developer logs in to the [Developer Console](https://open.feishu.cn/app), and in the **Development Configuration** > **Permission & Scopes** > **Data Permissions** page of the application details page, configure the **Range of contacts data to access** and add the specified user.<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/b88bdc2254c63737699a645229f81512_lWsyGqPzYb.png?height=278&maxWidth=550&width=1383)<br>Enterprise administrators of published applications can modify the contacts permission scope of the application in [Admin](http://feishu.cn/admin) > **Workplace** > **App Management** page.<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/d1ee8652cc8dabfc2baf5b3fa7bbbaa5_3CUi1nHM8q.png?height=278&maxWidth=550&width=1383)<br>- **Use user_access_token to call API**<br>When you use a user identity to call the contacts API, the scope of the operable permissions is not affected by the contacts permissions of the application, but by the current user's organizational structure visibility range, which limits the scope of organizational structure data visible to the user in the enterprise.<br>Enterprise administrators can manage it by clicking **Visibility scope of organization** in the [Admin](http://feishu.cn/admin) > **Security** > **Member Permissions** page.<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/57add68af3044c78059d112c8b08b2f7_MMuYjSfYI3.png?height=278&maxWidth=550&width=1383)<br>For a complete introduction, see [Authority Scope Resource Introduction](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority).
400 | 40011 | page size is invalid | Invalid paging parameter. The maximum value of page_size is 50.
400 | 40012 | page token is invalid error | Invalid paging parameter. You need to check whether the page_token passed in is the page_token value returned by the last request.
403 | 40004 | no dept authority error | No department authority. The department you are currently operating in must be within the address book permissions of the app. For the introduction and setting method of address book permission scope, please refer to [Permission Scope Resource Introduction](https://open.feishu.cn/document/ukTMukTMukTM/uETNz4SM1MjLxUzM/v3/guides/scope_authority).

For more error code information, see [General error codes](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN).

