Skip to content
Get started

Delete a file

files.delete(strfile_id) -> FileDeleteResponse
DELETE/v1/files/{file_id}

Delete a file. This cannot be undone.

ParametersExpand Collapse
file_id: str

The unique identifier of the file.

ReturnsExpand Collapse
class FileDeleteResponse:

Response from deleting a file.

Following the OpenAI API convention for delete responses.

id: str

The unique identifier of the deleted file.

deleted: Literal[true]

Whether the file was successfully deleted.

object: Literal["file"]

The object type, which is always 'file'.

Delete a file

import os
from deeptable import DeepTable

client = DeepTable(
    api_key=os.environ.get("DEEPTABLE_API_KEY"),  # This is the default and can be omitted
)
file = client.files.delete(
    "file_01kfxgjd94fn9stqm414vjb0s8",
)
print(file.id)
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "deleted": true,
  "object": "file"
}
Returns Examples
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "deleted": true,
  "object": "file"
}