API 参考
删除 File
逻辑删除 File,并调度清理其存储内容。
逻辑删除 File,并调度清理其存储内容。
端点
- 基础 URL
https://runapi.ai- API 版本
v1- 身份验证
Authorization: Bearer YOUR_API_KEY
02
JSON 请求体请求
只能在列出的请求位置发送值。
路径参数1 个字段
file_idstring
必填
RunAPI File ID.
03
HTTP 200成功响应
DELETE /v1/files/:file_id
JSON
{
"deleted": true,
"id": "file_abc123",
"object": "file"
}
04
HTTP 401错误响应 (401)
响应 Schema
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)
响应 Schema
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)
响应 Schema
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'