Claude Platform Docs

Files

Upload File
BetaFileMetadata beta().files().upload(FileUploadParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/files
List Files
FileListPage beta().files().list(FileListParamsparams = FileListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/files
Download File
HttpResponse beta().files().download(FileDownloadParamsparams = FileDownloadParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/files/{file_id}/content
Get File Metadata
BetaFileMetadata beta().files().retrieveMetadata(FileRetrieveMetadataParamsparams = FileRetrieveMetadataParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/files/{file_id}
Delete File
BetaDeletedFile beta().files().delete(FileDeleteParamsparams = FileDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/files/{file_id}
Models
class BetaDeletedFile:
String id

ID of the deleted file.

Optional<Type> type

Deleted object type.

For file deletion, this is always "file_deleted".

class BetaFileMetadata:
String id

Unique object identifier.

The format and length of IDs may change over time.

LocalDateTime createdAt

RFC 3339 datetime string representing when the file was created.

formatdate-time
String filename

Original filename of the uploaded file.

maxLength500
minLength1
String mimeType

MIME type of the file.

maxLength255
minLength1
long sizeBytes

Size of the file in bytes.

minimum0
JsonValue type "file"constant

Object type.

For files, this is always "file".

Optional<Boolean> downloadable

Whether the file can be downloaded.

Optional<LocalDateTime> 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
Optional<BetaFileScope> scope

The scope of this file, indicating the context in which it was created (e.g., a session).

String id

The ID of the scoping resource (e.g., the session ID).

JsonValue type "session"constant

The type of scope (e.g., "session").

class BetaFileScope:
String id

The ID of the scoping resource (e.g., the session ID).

JsonValue type "session"constant

The type of scope (e.g., "session").