Claude Platform Docs

Files

Upload File
FileMetadata files().upload(params, requestOptions = RequestOptions.none())
POST/v1/files
List Files
FileListPage files().list(params = FileListParams.none(), requestOptions = RequestOptions.none())
GET/v1/files
Download File
HttpResponse files().download(params = FileDownloadParams.none(), requestOptions = RequestOptions.none())
GET/v1/files/{file_id}/content
Get File Metadata
FileMetadata files().retrieveMetadata(params = FileRetrieveMetadataParams.none(), requestOptions = RequestOptions.none())
GET/v1/files/{file_id}
Delete File
DeletedFile files().delete(params = FileDeleteParams.none(), requestOptions = RequestOptions.none())
DELETE/v1/files/{file_id}
Models
class DeletedFile { type; id; }
Optional<Type> type

Deleted object type.

For file deletion, this is always "file_deleted".

String id

ID of the deleted file.

class FileExpiredErrorDetails { errorCode; }

The file's expires_at has passed, so its content is no longer available.

JsonValue errorCode = "file_expired"
class FileMetadata { type = "file"; id; createdAt; /* 5 more */ }
JsonValue type = "file"

Object type.

For files, this is always "file".

String id

Unique object identifier.

The format and length of IDs may change over time.

OffsetDateTime createdAt

RFC 3339 datetime string representing when the file was created.

formatdate-time
String filename

Original filename of the uploaded file.

minLength1
maxLength500
String mimeType

MIME type of the file.

minLength1
maxLength255
long sizeBytes

Size of the file in bytes.

minimum0
Optional<Boolean> downloadable

Whether the file can be downloaded.

Optional<OffsetDateTime> expiresAt

RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with expires_in_seconds, this is the upload time plus that value.

formatdate-time
class FileNotDownloadableErrorDetails { errorCode; }

The file has downloadable: false. Only files generated by a tool, such as the code execution tool, can be downloaded.

JsonValue errorCode = "file_not_downloadable"
class StorageQuotaExceededErrorDetails { errorCode; }

The organization's file storage quota is exhausted. Delete files to free up space, then retry the upload.

JsonValue errorCode = "storage_quota_exceeded"