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

# 删除 Identity

> 软删除一个 Forward Identity。

`DELETE /api/v1/forward/identities/{identity_id}`

当前实现为软删除：服务端内部标记 deleted，不级联删除历史 Session、事件或审计记录。

## 请求头

| Header        | 是否必填 | 说明             |
| ------------- | ---- | -------------- |
| Authorization | 是    | `Bearer <PAT>` |

## 路径参数

| 参数           | 类型     | 是否必填 | 说明                   |
| ------------ | ------ | ---- | -------------------- |
| identity\_id | string | 是    | Forward Identity ID。 |

## 示例请求

```bash theme={null}
curl -s -X DELETE 'https://api.qoder.com/api/v1/forward/identities/idn_019eabc123' \
  -H "Authorization: Bearer $QODER_PAT"
```

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "id": "idn_019eabc123",
  "deleted": true
}
```

## 响应字段

| 字段      | 类型      | 说明                |
| ------- | ------- | ----------------- |
| id      | string  | 被删除的 Identity ID。 |
| deleted | boolean | 是否已标记删除。          |

## 错误

| HTTP | Type                   | Code                      | 触发条件                   |
| ---- | ---------------------- | ------------------------- | ---------------------- |
| 404  | `not_found_error`      | -                         | Identity 不存在或当前调用方不可见。 |
| 409  | `conflict_error`       | -                         | 当前状态不允许删除。             |
| 401  | `authentication_error` | `authentication_required` | PAT 无效或已过期。            |

## 注意事项

* 删除后的 Identity 不允许继续创建 Session。
* 删除操作不会物理清理历史记录。

## 相关

<CardGroup cols={2}>
  <Card title="列出 Identities" icon="list" href="/cloud-agents/api/forward/identities/list" />

  <Card title="创建 Identity" icon="plus" href="/cloud-agents/api/forward/identities/create" />
</CardGroup>
