Skip to content

Files

Upload file bytes directly
files.create(FileCreateParams**kwargs) -> SGPFile
POST/v5/files
Import files from cloud storage
files.import_from_cloud(FileImportFromCloudParams**kwargs) -> FileImportFromCloudResponse
POST/v5/files/cloud_imports
List files
files.list(FileListParams**kwargs) -> SyncCursorPage[SGPFile]
GET/v5/files
Update a file
files.update(strfile_id, FileUpdateParams**kwargs) -> SGPFile
PATCH/v5/files/{file_id}
Get file metadata
files.retrieve(strfile_id, FileRetrieveParams**kwargs) -> SGPFile
GET/v5/files/{file_id}
Delete a file
files.delete(strfile_id, FileDeleteParams**kwargs) -> FileDeleteResponse
DELETE/v5/files/{file_id}
ModelsExpand Collapse
class SGPFile: …
id: str

The unique identifier of the entity.

created_at: datetime

The date and time when the entity was created in ISO format.

formatdate-time
created_by: Identity

The identity that created the entity.

id: str
type: Literal["user", "service_account"]
One of the following:
"user"
"service_account"
object: Optional[Literal["identity"]]
filename: str
md5_checksum: str
mime_type: str
size: int
duration_seconds: Optional[int]
object: Optional[Literal["file"]]
tags: Optional[Dict[str, object]]
class FileImportFromCloudResponse: …
results: List[Result]

Results for each file import attempt

file: ResultFile

The file object (full File for success, minimal _FailedFile for failures)

One of the following:
class SGPFile: …
id: str

The unique identifier of the entity.

created_at: datetime

The date and time when the entity was created in ISO format.

formatdate-time
created_by: Identity

The identity that created the entity.

id: str
type: Literal["user", "service_account"]
One of the following:
"user"
"service_account"
object: Optional[Literal["identity"]]
filename: str
md5_checksum: str
mime_type: str
size: int
duration_seconds: Optional[int]
object: Optional[Literal["file"]]
tags: Optional[Dict[str, object]]
class ResultFile_FailedFile: …

Minimal file representation for failed uploads containing only essential information.

filename: str

The original filename from the request

mime_type: str

The original MIME type from the request

object: Optional[Literal["failed_file"]]
status: Literal["SUCCESS", "FAILED_FILE_DOES_NOT_EXIST", "FAILED_INVALID_PERMISSIONS", "FAILED_UNKNOWN_ERROR"]

The status of the upload attempt

One of the following:
"SUCCESS"
"FAILED_FILE_DOES_NOT_EXIST"
"FAILED_INVALID_PERMISSIONS"
"FAILED_UNKNOWN_ERROR"
class FileDeleteResponse: …
id: str
deleted: bool
object: Optional[Literal["file"]]

FilesContent

Download file content
files.content.retrieve(strfile_id, ContentRetrieveParams**kwargs) -> object
GET/v5/files/{file_id}/content