# Batch delete collaborator

This API is to delete multiple collaborators from a task.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator
HTTP Method | POST
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.** | View, create, update, and delete Task (legacy version)(task:task)
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>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)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Path parameters

Parameter | Type | Description
---|---|---
task_id | string | Task ID<br>**Example value**: "83912691-2e43-47fc-94a4-d512e03984fa"

### 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
---|---|---|---
id_list | string\[\] | No | List of collaborator ids added when creating the task. The value passed in is user_id or open_id, determined by user_id_type. For details, see: [How to get ID](https://open.feishu.cn/document/home/user-identity-introduction/open-id)<br>**Example value**: ["ou_550cc75233d8b7b9fcbdad65f34433f4"]

### Request body example
```json
{
    "id_list": ["ou_13585843f02bc94923ed17a007cbc9b1", "ou_f4506885e436763c36e03c05ef1bd6f8"]
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
collaborators | string\[\] | Multiple collaborators' id have been deleted.

### Response body example
```json
{
    "code": 0,
    "data": {
        "collaborators": [
            "ou_13585843f02bc94923ed17a007cbc9b1",
            "ou_f4506885e436763c36e03c05ef1bd6f8"
        ]
    },
    "msg": ""
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
403 | 1470403 | The identity token is incorrect. It should be either user_access_token or tenant_access_token. | The identity token is incorrect. It should be either user_access_token or tenant_access_token.
400 | 1470450 | There are too many requests currently, please try again later. | There are too many requests currently initiated at the same time, and the peak value is high, resulting in current limit, please try again later.
400 | 1470451 | Operation requests for the same task are too frequent. | The operation request for the same task is too frequent, and the request frequency needs to be reduced
400 | 1470602 | Invalid task id. | Check whether the task ID is valid.
500 | 1470702 | failed to delete task collaborator | Failed to delete the specified task collaborator. Perform troubleshooting based on the returned error information. If the problem persists, provide the request ID and contact Feishu technical personnel for assistance.
400 | 1470404 | Be refused to update task, possibly due to lack of permission. | Generally, the creation or update task fails because the operator does not have operation permission. For example, the task follower has no permission to modify the task.

