Skip to content
Get started

Delete a file

client.files.delete(stringfileID, RequestOptionsoptions?): FileDeleteResponse { id, deleted, object }
DELETE/v1/files/{file_id}

Delete a file. This cannot be undone.

ParametersExpand Collapse
fileID: string

The unique identifier of the file.

ReturnsExpand Collapse
FileDeleteResponse { id, deleted, object }

Response from deleting a file.

Following the OpenAI API convention for delete responses.

id: string

The unique identifier of the deleted file.

deleted: true

Whether the file was successfully deleted.

object: "file"

The object type, which is always 'file'.

Delete a file

import DeepTable from '@deeptable/deeptable';

const client = new DeepTable({
  apiKey: process.env['DEEPTABLE_API_KEY'], // This is the default and can be omitted
});

const file = await client.files.delete('file_01kfxgjd94fn9stqm414vjb0s8');

console.log(file.id);
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "deleted": true,
  "object": "file"
}
Returns Examples
{
  "id": "file_01kfxgjd94fn9stqm414vjb0s8",
  "deleted": true,
  "object": "file"
}