删除客户数据
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
DELETE
/agent/v1/agents/{agent_id}/customers/{customer_id}● 支持请求参数
agent_idstring必填path: Active service agent id from agent creation or listing. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_….
customer_idstring必填path: Customer id from customer listing, or your own customer_id.
confirmstring必填query: 必须与路径参数 customer_id 完全一致,以确认破坏性删除。
返回
202
仅 develop。confirm 必须等于 customer_id。先封禁和吊销,再保存七天快照,随后删除。
错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码
请求示例
curl
# 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
curl -X DELETE "https://api.deepraxis.com/agent/v1/agents/agent_123/customers/docs-sample?confirm=docs-sample" \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
# 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.delete(
f"{opts['base_url']}/v1/agents/agent_123/customers/docs-sample?confirm=docs-sample",
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())TypeScript
// 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/agents/agent_123/customers/docs-sample?confirm=docs-sample`, {
method: "DELETE",
headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
});
console.log(resp.status, await resp.json());响应示例 202
{
"id": "eud_8a5f88fd-efbd-4475-bdc9-ec4e140bba01",
"status": "pending"
}响应
HTTP 202
Deletion accepted; poll the deletion endpoint until done or failed.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Deletion task identifier. |
| status | string | Accepted for asynchronous processing; poll deletion for progress. |
运行示例前
先创建服务智能体,并为自己的测试客户 docs-sample 通过客户面(/customer/v1)签发授权码并换取访问令牌;替换 agent_123。解封测试前先封禁该客户。删除时 confirm 必须与客户 ID 一致;测试结束后吊销令牌、删除测试客户数据,再归档智能体。