跳至主要内容
版本:PrivStation 2.6.0
Markdown 原文

刪除單一檔案

此 API 用於刪除指定的檔案(File)。

透過提供檔案的 file_id,你可以將該檔案從系統中移除。不過,若該檔案仍被包含於任何 Fileset 中,系統將阻止刪除操作,並回傳錯誤。

請先移除該檔案與所有 Fileset 的關聯,才能成功執行刪除。

檔案刪除後將無法復原,也無法再被檢索或用於問答。

curl -X 'DELETE' \
'http://127.0.0.1:8000/v1/files/{file_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <your-api-key>'

Request Headers​

KeyValue
Request MethodDELETE
acceptapplication/json
AuthorizationBearer <your-api-key>

Query Parameters​

FieldTypeNoteRequired
file_idstringuuidtrue

Response Body​

{
"id": "b0d1bdbc-4f94-40b0-9358-68c579c99e8c",
"object": "file",
"deleted": true
}

Field Explanation

FieldDetail
id刪除之檔案 ID
object(與 OpenAI 相容而保留)
deleted是否已刪除