查詢檔案刪除進度
查詢自有檔案刪除請求的狀態與累計進度
中國大陸用戶請注意: 中國大陸用戶請使用 https://api.toapis.cn 作為接口地址 (Base URL). 文檔示例中的 https://api.toapis.com 請替換為 https://api.toapis.cn.
使用說明
查詢目前帳號的刪除進度, 他人或不存在的請求皆回傳 404. 計數非同步更新, 檔案從清單移除後仍保留累計刪除數. processed 表示目前已發現範圍處理完成; 延遲登記的舊檔案可能使範圍與狀態再次變動, 不表示未登記物件也已清理.
驗證
Authorizationstring請求頭必填使用系統存取權杖, 格式為 Bearer YOUR_SYSTEM_ACCESS_TOKEN. 不接受模型 API Key, 無需 X-User-Id. 僅操作目前驗證帳號自己的檔案與策略, 不合併子帳號資料.
請求參數
idstring路徑必填建立刪除請求時回傳的十進位字串 id, 例如 "456". 這是刪除請求 ID, 不是檔案 ID.
無查詢參數或請求主體. 未知或重複的查詢參數回傳 400.
請求示例
curl --request GET \
--url 'https://api.toapis.com/api/v1/user/file/deletion-requests/456' \
--header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'import requests
response = requests.get(
"https://api.toapis.com/api/v1/user/file/deletion-requests/456",
headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
timeout=30,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.toapis.com/api/v1/user/file/deletion-requests/456", {
method: "GET",
headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());回應欄位
範例使用虛構資料. 共用回應格式見接入方式.
data.idstring查詢進度使用的刪除請求 ID.
data.scopestringsingle 表示刪除一個指定檔案; all 表示清空目前帳號已有檔案.
data.file_idstring | null單檔範圍為檔案 ID, 批次範圍為 null.
data.created_before_atstring | null批次範圍的建立時間截止點, 包含該時刻; 單檔為 null.
data.statestringpending 已受理; running 處理中; processed 目前範圍完成; blocked 有受阻檔案或進度更新失敗.
data.discovered_countinteger目前發現的範圍內檔案數, 延遲登記可能使其增加.
data.deleted_countinteger累計已刪除的檔案數. 檔案從清單移除後, 此計數仍保留.
data.blocked_countinteger目前受阻檔案數. 進度更新失敗也可能標為 blocked, 此時計數保留上次成功值.
data.created_atstring請求建立時間.
data.updated_atstring進度最近更新時間.
響應示例
{
"code": 0,
"message": "",
"data": {
"id": "456",
"scope": "single",
"file_id": "123",
"created_before_at": null,
"state": "processed",
"discovered_count": 1,
"deleted_count": 1,
"blocked_count": 0,
"created_at": "2026-11-16T08:00:00Z",
"updated_at": "2026-11-16T08:02:00Z"
}
}錯誤處理
請求 ID 或查詢參數無效時回傳 400. 刪除請求不存在或屬於其他帳號時回傳 404; 進度讀取暫時無法使用時回傳 503.
共用驗證, 速率限制與錯誤處理見接入方式.