Claude Platform Docs

Delete File

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

Delete File

Parameters
file_id: String

ID of the File.

Returns
class DeletedFile { id, type }
id: String

ID of the deleted file.

type: :file_deleted

Deleted object type.

For file deletion, this is always "file_deleted".

Delete File

require "anthropic"

anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")

deleted_file = anthropic.files.delete("file_id")

puts(deleted_file)
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "type": "file_deleted"
}
Returns Examples
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "type": "file_deleted"
}