Skip to content
DELETE /file/{id}

Permanently deletes the file’s bytes, its row, every grant on it and its routing index entry. 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 a console button or a backend sends, never a link someone clicks). A caller who is not the owner gets `403` ("Only the owner…") whenever any tier reaches the file for them — an explicit grant, 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 no tier reaches. A second delete of the same id is a `404`.

Path Parameters

idstring
required·

File id (file_…).

Response Body

successboolean
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())