# Obtain desensitized user login information in batches

This interface is used to query the user's login information.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/passport/v1/sessions/query
HTTP Method | POST
Rate Limit | [10 per minute](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Obtain user's login information (mask)(passport:session_mask:readonly)
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 ID(contact:user.employee_id:readonly)

### 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)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### 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)

### Request body

Parameter | Type | Required | Description
---|---|---|---
user_ids | string\[\] | No | User ID<br>**Example value**: ["47f621ff"]<br>**Data validation rules**:<br>- Maximum length: `100`

### Request body example
```json
{"user_ids":["7aeddb6a1","7aeddb6a2","7aeddb6a3"]}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
mask_sessions | mask_session\[\] | User Login Information
create_time | string | Creation time
terminal_type | int | Client side type<br>**Optional values are**:<br>- 0：Unknown<br>- 1：Personal computer<br>- 2：Browser<br>- 3：Android phone<br>- 4：Apple phone<br>- 5：Server<br>- 6：old version mini program<br>- 8：other mobile
user_id | string | User ID
sid | string | The session identifier that needs to be logged out

### Response body example
```json
{
    "code":0,
    "data":{
        "mask_sessions":[
            {
                "create_time":"1644980493",
                "terminal_type":2,
                "user_id":"47f183f1f1",
                "sid":"ABBAAAAAAANll6nQoIAAFA=="
            },
            {
                "create_time":"1644983127",
                "terminal_type":2,
                "user_id":"47f183ff1",
                "sid":"ACCAAAAAAANll6nQoIAAFA=="
            },
            {
                "create_time":"1644983127",
                "terminal_type":2,
                "user_id":"47f183ff2",
                "sid":"BBBAAAAAAANll6nQoIAAFA=="
            }
        ]
    },
    "msg":""
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1080001 | param is invalis | Invalid parameter

