> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Delete Attendance Members

> Call this API to remove members from an attendance group by group ID and user list, with up to 100 userIds per call.

Call this API to batch delete members from a specified attendance group.

## API Call Description

This API only deletes attendance members in an attendance group. It does not delete departments that participate in attendance.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/users/remove](https://api.dingtalk.io/topapi/attendance/group/users/remove) |
| HTTP Method | POST |
| Supported App Types | appType-Internal app |
| Permissions | permission-qyapi\_attendance\_group\_manage-Attendance group management permission |

### Query Parameters

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| access\_token | String | Yes | 4c9ebd2b153xxxx | The App credential used to call this API. Obtain it by calling the [Get the access\_token of an Internal App](https://help.dingtalk.io/open/development/obtain-orgapp-token) API. |

### Request Body

| Name | Type | Required | Example | Description |
| - | - | - | - | - |
| op\_userid | String | No | user01 | The userId of the operator. |
| group\_key | String | Yes | 0151E0223B1xxxx | The attendance group ID.  **Note**  If your attendance group identifier is group\_id, call the [Convert groupId to groupKey](https://help.dingtalk.io/open/development/groupid-to-groupkey.md) API to convert group\_id to group\_key. |
| user\_id\_list | String\[] | Yes | user01,user02 | The user list. Pass up to 100 userIds per call. |

### Request Example

```curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/users/remove" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=49ceexxxx4c192' \
-d 'group_key=0151E022xxxx917E876' \
-d 'op_userid=123456' \
-d 'user_id_list=123456%2C123457'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/remove");
OapiAttendanceGroupUsersRemoveRequest req = new OapiAttendanceGroupUsersRemoveRequest();
req.setOpUserid("user01");
req.setGroupKey("0151E0223B1xxxx");
req.setUserIdList("user01,user02");
OapiAttendanceGroupUsersRemoveResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import dingtalk.api

req=dingtalk.api.OapiAttendanceGroupUsersRemoveRequest("https://api.dingtalk.io/topapi/attendance/group/users/remove")

req.op_userid="123456"
req.group_key="0151E022xxxx17E876"
req.user_id_list="123456,123457"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiAttendanceGroupUsersRemoveRequest;
$req->setOpUserid("123456");
$req->setGroupKey("0151E0xxxx7E876");
$req->setUserIdList("123456,123457");
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/users/remove");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/users/remove");
OapiAttendanceGroupUsersRemoveRequest req = new OapiAttendanceGroupUsersRemoveRequest();
req.OpUserid = "123456";
req.GroupKey = "0151E0xxxx17E876";
req.UserIdList = "123456,123457";
OapiAttendanceGroupUsersRemoveResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
```

## Response

### Response Body

| Name | Type | Example | Description |
| - | - | - | - |
| result | Result | | The returned result. |
| error\_info\_list | ErrorInfo\[] | | The error list. |
| failure\_list | String\[] | | The list of failed items. |
| msg | String | business fault | The error description. |
| code | String | 1000 | The error code. |
| success\_list | String\[] | | The list of successful items. |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The return code description. |
| success | Boolean | true | Indicates whether the call succeeded.   - **true**: Success - **false**: Failed |
| request\_id | String | 47qflcctatn2 | The request ID. |

### Response Body Example

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "errcode": 0,
  "errmsg":"ok",
  "result": {
    "success_list": [
      "user01",
      "user02"
    ]
  },
  "success": true,
  "request_id": "47qflcctatn2"
}
```

### Error Codes

If the API call returns an error, find a solution in the [Global Error Codes](https://help.dingtalk.io/open/development/server-api-error-codes-1.md) document based on the error message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.