> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trae.cn/llms.txt?lang=zh
> Use this file to discover all available pages before exploring further.

将指定成员从企业中删除。

## 所需权限 {#45b07a22}

`users:delete`

## 请求说明 {#hnnz5TB5D}

* 请求方式：`DELETE`
* 请求地址：`{域名}/openapi/v1/users`

## 注意事项 {#hVuGji2oY}


* 本接口支持批量部分成功，顶层 `code=0` 仅表示请求处理完成，不代表每个成员均删除成功，需根据 `failed_items` 判断逐项结果。
* 当企业成员由外部身份源（包括火山引擎云身份中心）统一管理时，不支持通过该接口删除成员。

## 请求参数 {#请求}

### 请求头参数 {#请求头参数}

<!-- @cols-width: 172,122,596 -->
| **Header 参数**  | **是否必填**  | **描述**  |
| --- | --- | --- |
| `Authorization`  | 是  | 固定取值为 `Bearer {access_token}`。关于如何获取访问令牌，参考[鉴权](enterprise_authentication)。  |
| `Content-Type`  | 是  | 固定取值为 `application/json`。  |

### 请求体参数 {#cbf5656a}

<!-- @cols-width: 183,183,150,397 -->
| **参数**  | **类型**  | **是否必填**  | **描述**  |
| --- | --- | --- | --- |
| `user_ids`  | string[]  | 条件必填  | 待删除成员的 ID，最多 100 个。  |
| `emails`  | string[]  | 条件必填  | 待删除成员的邮箱，最多 100 个。  |

:::tip 提示
* `user_ids` 和 `emails` 参数只需提供其中一个。
* 由于 `user_ids` 的优先级高于 `emails`，若同时传入两个参数，`emails` 会被忽略。
:::

## 响应参数 {#159eefad}

该接口独有的响应参数如下，参数位于 `data` 对象中。通用响应参数参考[此文档](/enterprise_general-response-schema)。

<!-- @cols-width: 213,107,593 -->
| **参数**  | **类型**  | **描述**  |
| --- | --- | --- |
| `success_count`  | int  | 成功删除的成员数量。  |
| `failed_items`  | array  | 删除失败的成员列表。  |
| `failed_items[].email`  | string  | 删除失败的成员标识。通过 `emails` 指定成员时返回原始邮箱；通过 `user_ids` 指定成员且未找到成员时，返回用户 ID 的字符串形式。  |
| `failed_items[].code`  | int  | 错误码。详情参考[错误码](/enterprise_error-codes)。  |
| `failed_items[].message`  | string  | 失败原因。  |

## 示例 {#示例}

### 请求示例 {#98f239a3}

```Bash
curl -X DELETE "${HOST}/openapi/v1/users" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": ["alice@example.com", "john@example.com"]
  }'
```

### 响应示例 {#4f6f7138}

```JSON
{
  "code": 0,
  "message": "success",
  "request_id": "req_xxx",
  "data": {
    "success_count": 1,
    "failed_items": [
      {
        "email": "john@test.com",
        "code": 30007,
        "message": "user not found"
      }
    ]
  }
}
```

## 错误码 {#错误码}

若该接口的请求返回错误码，参考[错误码](/enterprise_error-codes)文档进行排查。
