# Configure app data permissions

App data permission refers to the scope of data accessible when accessing business resources with the app identity (tenant_access_token). After the app has applied for some app identity permissions (for example, Contacts, Feishu CoreHR Enterprise Edition), you also need to configure the corresponding data permissions and submit a review request. The permissions will take effect upon approval, allowing successful API calls to retrieve data. Otherwise, calling the API will result in a permission error.

See [Applying for API Scopes](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN) for an introduction to different permission types.

## Introduction to data permissions

Both custom applications and store applications support configuring data permissions, but the supported APIs and methods differ.

### Data permissions for custom apps

When applying for some API permissions in the **Contacts**, **Organization**, **Tasks**, **Email**, **Feishu CoreHR Business**, **Minutes**, or **Payroll** business domains for custom applications, data permissions must be configured.

Data permission type | Permission description | Management method
---|---|---
[Contacts](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/resources) | When calling the Contacts API using the application identity, the data scope that the application can access from the Contacts is determined. For example, to query information of user A via the Contacts API, the application needs user A's data permission.<br>By default, the Contacts permission scope is consistent with the application's [available scope](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability).<br>**Notice**： | - Method 1: Application owner, administrator, or developer role configures the Contacts permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.<br>- Method 2: Enterprise administrator configures the Contacts permission scope for specific applications in the [Admin Console](https://www.feishu.cn/admin).
[Organization](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/directory-v1/overview) | When calling the Organization Structure API using the application identity, the data scope of the organization members that the application can access is determined. For example, to update employee information using the Organization Structure API, the application needs data permission for that employee.<br>By default, the organization structure data permission scope is not configured. After adding the corresponding API permissions, data permissions need to be manually configured.<br><md-alert>The organization structure data permission scope only supports specifying employee scope, not department scope, meaning it inherently includes data access for all departments within the enterprise. | The application owner, administrator, or developer role configures the organization structure permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.
[Feishu CoreHR Business](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/overview) | When calling the Feishu HR (Enterprise Edition) API using the application identity, the data scope that the application can access is determined. For example, to query information about department B using the Feishu HR API, the application needs data permission for department B.<br>By default, the Feishu HR (Enterprise Edition) data permission scope is empty, meaning the scope is not configured. | The application owner, administrator, or developer role configures the Feishu HR (Enterprise Edition) data permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.
[Tasks](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/task-v2/overview) | When calling the Tasks API using the application identity, the data scope of tasks or lists that the application can access is determined. For example, to query task details using the Tasks API, the application needs data permission for the owner of the task list.<br>By default, task data permission scope is not configured. After adding the corresponding API permissions, data permissions need to be manually configured. | The application owner, administrator, or developer role configures the task data permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.
[Mail](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/user_mailbox-folder/create) | When calling the Mail API using the application identity, the data scope of mail-related resources that the application can access is determined. For example, to query a specific public mailbox using the Mail API, the application needs data permission for that public mailbox.<br>By default, mail data permission scope is not configured. After adding the corresponding API permissions, data permissions need to be manually configured. | The application owner, administrator, or developer role configures the mail data permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.
[Minutes](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/minutes-v1/minute-media/get) | When calling the Documents API using the application identity, the data scope of document-related resources that the application can access is determined. For example, to fetch document information using the Documents API, the application needs data permission for the owner of the document.<br>By default, document data permission scope is not configured. After adding the corresponding API permissions, data permissions need to be manually configured. | The application owner, administrator, or developer role configures the document data permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.
[Payroll](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/payroll-v1/payment_activity_detail/list) | When calling the Payroll API using the application identity, the data scope of payroll-related resources that the application can access is determined. For example, to query payroll details using the Payroll API, the application needs data permission for the corresponding payroll group.<br>By default, payroll data permission scope is not configured. After adding the corresponding API permissions, data permissions need to be manually configured. | The application owner, administrator, or developer role configures the payroll data permission scope in the [Developer Console](https://open.feishu.cn/app) within the application.

Once an application is granted the corresponding data permissions, it can add, delete, modify, and query these data. Therefore, after configuring data permissions, the developer must release the application and wait for the application reviewers to approve it before the data permissions take effect.

### Data permissions for store apps

Store applications only support enterprise administrators configuring **Contacts** data permissions and do not support configuring data permissions for other open capabilities. Developers can call [Get contacts authorization scope](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list) to view the application's data permissions.

Data permission type | Permission description | Management method
---|---|---
Contacts Permissions Scope | When calling the Contacts API using the application identity, the data scope that the application can access from the Contacts is determined. For example, to query information of user A via the Contacts API, the application needs user A's data permission. | Configured by the enterprise administrator in the Admin Console for the specified application.

## Custom enterprise apps

When applying for Contacts, Organization, or Feishu CoreHR Business API permissions for custom enterprise applications, the configuration of application data permissions scope is involved, and the method of configuring data permissions varies under different businesses. The specific steps are as follows.
If you switch the application to the testing version for integrated development and debugging using the [Testing enterprise and personnel](https://open.feishu.cn/document/home/introduction-to-custom-app-development/testing-enterprise-and-personnel-functions) capabilities, the application will have default data permissions for all members of the enterprise, facilitating debugging work during the testing phase.

1. When enabling [API permissions](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN) for a company’s self-built application, if you need to configure the data scope accessible by the application identity permissions, it will automatically redirect as shown in the following figure.

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/eb093691d4c8cd532f225ed535e59403_lsxz263eKE.png?height=1546&lazyload=true&maxWidth=600&width=2076)

If you need to manage the data scope of already enabled API permissions, log in to the [Feishu Developer Console](https://open.feishu.cn/app), go to the self-built application's **Development Configuration** > **Permission & Scopes** page, and click **Configure** on the right side of the **Range of accessible data** column in the permission list to enter the data permission configuration page.

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/b44aa78a0fdbb93f95881941bdc1fdd0_szbpuXmITv.png?height=1172&lazyload=true&maxWidth=600&width=2350)

2. Complete the data permission configuration on the **Accessible data range for tenant token scopes** interface.

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/5e10ed809c28585f5c43be782425df1f_rWZCuUfmC8.png?height=1036&lazyload=true&maxWidth=600&width=1800)

- The left side of the interface (area ① in the above image) shows the list of business items corresponding to the requested API permissions; click to switch to configure data permissions for the corresponding business.
	- The top right of the interface (area ② in the above image) displays the application identity permission information currently applied for this business.
	- The lower right of the interface (area ③ in the above image) configures the accessible data scope for the current business permission.

3. Click **Configure** in the **Range of data that can be accessed by the scopes above** area.

The configuration methods differ by business domain, detailed as follows:

Service domain | Configuration description
---|---
Contacts | Select and configure a specific data range. By default, the data permission range for the contact book is **Identical to the availability of app**.<br>- **Identical to the availability of app**: The contact book permission range is consistent with the application’s available range. For detailed information about the application’s available range, see [Configure Application Availability](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability).<br>- **Selected members**: After selecting this range, you also need to manually select departments or members to confirm the contacts is permission range.<br>- **All members**: Data permissions for all members and departments within the enterprise.<br>**Notice**：![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/64f4445647cd66aecae18d38667ddfb4_dGixO0gRC8.png?height=714&lazyload=true&maxWidth=500&width=2338)
Organizational | Select and configure a specific data range:<br>- **All**: Data permissions for all members and departments within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for employees who meet the conditions.<br><md-alert><br>- The supported filtering conditions are subject to the data available on the actual page. For example, if configured as `Member contains Identical to the availability of app`, it means that the member permission range that the application can access is consistent with the application’s available range. For detailed information about the application’s available range, see [Configure app availability](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability).<br>- The organizational structure data permission range only supports specifying employee ranges and does not support specifying department ranges, i.e., it fixedly includes data access permissions for all departments within the enterprise. <br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/aaf678970d4c687462f670c621797396_8dUWmy96Az.png?height=732&lazyload=true&maxWidth=500&width=1264)
Feishu CoreHR Business | Select and configure a specific data range:<br>- **All**: Data permissions for all members and departments within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for employees or departments that meet the conditions.<br>**Notice**：![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/7b1487f4b920873f7f082507a04706cc_jrgeitn7Wv.png?height=722&lazyload=true&maxWidth=500&width=1268)
Tasks | Select and configure a specific data range:<br>- **All**: Data permissions for all tasks within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for tasks that meet the conditions.<br><md-alert>The supported filtering conditions are subject to the data available on the actual page. For example, in **Resource - Restricted Query Task Details**, setting the filter condition `Task Owner contains Identical to the availability of app` means that the application can access the data range of the task owners consistent with the application’s available range. For detailed information about the application’s available range, see [Configure app availability](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability).<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/3e7ceca96ee2dfbddf7b62ac8c86e48b_fFQpSbWg37.png?height=682&lazyload=true&maxWidth=500&width=1278)
Email | Select and configure a specific data range:<br>- **All**: Data permissions for all emails within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for emails that meet the conditions.<br>**Notice**：![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/2c14684a390c82a183ce5389ccf66a7b_ZdkoC5mW2M.png?height=718&lazyload=true&maxWidth=500&width=1258)
Minutes | Select and configure a specific data range:<br>- **All**: Data permissions for all Minutes within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for notes that meet the conditions.<br><md-alert>The supported filtering conditions are subject to the data available on the actual page. For example, in **Resource - Minutes Basic Info**, setting the filter condition `Minutes Owner Scope contains Identical to the availability of app` means that the application can access the data range of public notes owners consistent with the application’s available range. For detailed information about the application’s available range, see [Configure app availability](https://open.feishu.cn/document/home/introduction-to-scope-and-authorization/availability).<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/f5e5794bc4cdbf9fa4e96925f329ac66_hdtUJcee4r.png?height=644&lazyload=true&maxWidth=500&width=1272)
Payroll | Select and configure a specific data range:<br>- **All**: Data permissions for all Payroll within the enterprise.<br>- **Filter by condition**: Manually set filtering conditions to obtain data permissions for Payroll that meet the conditions.<br><md-alert>The supported filtering conditions are subject to the data available on the actual page. For example, in **Resource - Payment Detail**, setting the filter condition `Payroll Group equals to xxx Payroll Group` means that the application can access the payroll details within the specified payroll group.<br>![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/6394a5e6dca27e25acc512a43378bbed_8ZrMlWf8OS.png?height=340&lazyload=true&maxWidth=500&width=1270)

4. After completing the configuration, click **Save**.

## Store apps

The store apps only supports the organization administrator to find the specified app in the workplace of [Admin console](https://feishu.cn/admin) and modify the app's contacts data range.
App developers can call the [Obtain the contacts permission scope](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/scope/list) API to view the data permissions of the app.

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/7f25ab961a023c281077f205e32c3fdc_rCULw0ql44.png?height=628&lazyload=true&maxWidth=600&width=2334)
