Use the delete method to delete a file.

try {
  const fileId = 'file_id_here' // The ID of the file to delete.
  await sdk.file.delete(fileId)
  console.log(`File with ID ${fileId} has been deleted.`)
} catch (error) {
  console.error(error.message)
}

Params

  • fileId (string): The ID of the file you want to delete.

Required API Key Permission

  • Delete File