Skip to content

Delete a file

files.delete(strfile_id, FileDeleteParams**kwargs) -> FileDeleteResponse
DELETE/v5/files/{file_id}

Delete a file by id, removing its database record.

This is a hard delete: the file’s row is removed from the database, not soft-archived. The underlying stored object is deleted only when no other file record still references the same stored content (identical checksum and MIME type); when another record shares the blob, the blob is retained. If the id refers to an incomplete multipart upload placeholder, its staged parts are aborted instead. Returns a confirmation carrying the deleted file’s id.

ParametersExpand Collapse
file_id: str
x_project_id: Optional[str]
ReturnsExpand Collapse
class FileDeleteResponse: …
id: str
deleted: bool
object: Optional[Literal["file"]]

Delete a file

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
file = client.files.delete(
    file_id="file_id",
)
print(file.id)
{
  "id": "id",
  "deleted": true,
  "object": "file"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "file"
}