# Get a list of roles in batch

Batch query the role list in "Role Settings" in Feishu's personnel management backend. You can find the corresponding location by following "Feishu Personnel" - "Permission Settings" - "Role Settings". The role list contains information such as the role's ID, role name, and description.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/security_groups
HTTP Method | GET
Rate Limit | [100 per minute](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 | Obtain core HR information(corehr:corehr:readonly)<br>获取角色信息(corehr:security_group:read)<br>Update core HR information(corehr:corehr)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-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
---|---|---|---
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**: 10
page_size | string | Yes | Page size<br>**Example value**: 100

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
items | security_group\[\] | Queried user persona information
id | string | Role ID
code | string | Character code
name | name | Role name
zh_cn | string | Chinese
en_us | string | English
active_status | int | Status. Possible value:<br>- 1 = Inactive <br>- 2 = Active <br>- 3 = TobeActivated
description | name | Role description
zh_cn | string | Chinese
en_us | string | English
group_type | int | role type<br>- 3 = organizational roles<br>- 7 = non-organizational roles
created_by | string | founder<br>- When "sys" is returned, it means that the role is created by the system.<br>- When the user ID is returned, it means that the role is a user-defined role. You can use the [ID conversion service](https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/common_data-id/convert) to exchange for Feishu HR's employment_id.
update_time | string | Update time
org_truncation | org_truncation\[\] | Management dimension
org_key | string | Management dimension
type | int | Drill down type
depth | int | Drill down depth
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

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "items": [
            {
                "id": "7034393015968122400",
                "code": "department_manager",
                "name": {
                    "zh_cn": "cn",
                    "en_us": "en"
                },
                "active_status": 1,
                "description": {
                    "zh_cn": "cn",
                    "en_us": "en"
                },
                "group_type": 1,
                "created_by": "6967639606963471902",
                "update_time": "1",
                "org_truncation": [
                    {
                        "org_key": "department",
                        "type": 0,
                        "depth": 0
                    }
                ]
            }
        ],
        "has_more": true,
        "page_token": "1234452132"
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1161401 | Incorrect parameter type | Please check the parameter types, such as string and number
400 | 1161402 | Incorrect parameter range | Please check if the numeric parameters are within the specified range
400 | 1161403 | Incorrect parameter length | Please check parameters of the container type, such as List and Map
400 | 1161404 | Missing or invalid parameter | Please check if the parameters are valid
400 | 1161405 | Parameter parsing error | Please check the JSON format of the request body
400 | 1161406 | Parameter exceeds the optional range | Please check the available options for parameters of the enumeration type
500 | 1161501 | System internal error | Please contact [technical support](https://applink.feishu.cn/TLJpeNdW)

