Delete an uploaded file that no document uses
curl --request DELETE \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"deleted": true,
"file_purged": true,
"purge_reason": "DELETED"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Files
Delete an uploaded file that no document uses
Deletes a file uploaded to the storage workspace, for example one whose
attachment to a knowledge base failed. Only the user who uploaded it
may delete it, whatever their organization role (platform
administrators may delete anyone’s upload). A file still used by a
document answers 409 FILE_IN_USE: delete the document instead
(DELETE /v1/knowledge_bases/{knowledgeBaseId}/documents/{documentId}),
which also releases the file.
DELETE
/
v1
/
files
/
{fileId}
Delete an uploaded file that no document uses
curl --request DELETE \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/files/{fileId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"deleted": true,
"file_purged": true,
"purge_reason": "DELETED"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
User session JWT or instance API key (iak_*). Send as Authorization: Bearer <token>.
Path Parameters
Id of the file uploaded to the storage workspace (POST /v2/workspaces/slug:storage/files).
Maximum string length:
128Was this page helpful?