API 參考
刪除檔案
邏輯刪除檔案並排程清理其儲存內容。
邏輯刪除檔案並排程清理其儲存內容。
端點
- 基礎 URL
https://runapi.ai- API 版本
v1- 身分驗證
Authorization: Bearer YOUR_API_KEY
02
JSON 請求內文請求
僅在列出的請求位置中傳送值。
路徑參數1 個欄位
file_idstring
必填
RunAPI 檔案 ID。
03
HTTP 200成功回應
DELETE /v1/files/:file_id
JSON
{
"deleted": true,
"id": "file_abc123",
"object": "file"
}
04
HTTP 401錯誤回應 (401)
回應綱要
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
回應範例
JSON
{
"error": {
"code": "authentication_error",
"message": "Missing API key",
"param": null,
"type": "authentication_error"
}
}
05
HTTP 404錯誤回應 (404)
回應綱要
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
回應範例
JSON
{
"error": {
"code": "not_found",
"message": "File not found",
"param": null,
"type": "invalid_request_error"
}
}
06
HTTP 502錯誤回應 (502)
回應綱要
JSON
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
回應範例
JSON
{
"error": {
"code": "storage_write_failed",
"message": "File storage failed",
"param": null,
"type": "server_error"
}
}
07
cURL 範例
CURL
curl -X DELETE https://runapi.ai/v1/files/file_abc123 \
-H 'Authorization: Bearer YOUR_API_KEY'