Delete a tool file
/file/{id}
Permanently deletes the file’s bytes, its record and every share on it. Irreversible, and it takes the file away from everyone it was shared with. Audited as `file.deleted`. Owner only: the person who ran the tool, not the owner of the connection behind it. Unlike the content route this one requires `X-Organization-Id` (it is a command, never a link someone clicks). A caller who is not the owner gets `403` ("Only the owner…") whenever the file is visible to them (an explicit share, or `use` on its source connection or toolbox, since it is in their `GET /file`); `404` for everyone else, including a malformed or unknown id, an expired file, and a member the file does not reach. A second delete of the same id is a `404`.
Path Parameters
File id (file_…).
Response Body
curl -X DELETE 'https://api.elaichi.ai/file/<id>' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json'const response = await fetch('https://api.elaichi.ai/file/<id>', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/file/<id>"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
print(response.json())