Skip to content

List files

files.list(FileListParams**kwargs) -> SyncCursorPage[SGPFile]
GET/v5/files

List the account’s files with pagination.

Optionally filter by filename (case-insensitive partial match). Results are scoped to the files the caller is authorized to read. Files marked hidden (internal or service-owned artifacts) are excluded from this listing but remain retrievable by id. Returns file metadata only, not content.

ParametersExpand Collapse
ending_before: Optional[str]
filename: Optional[str]

Filter files by filename (case-insensitive partial match)

limit: Optional[int]
maximum10000
minimum1
sort_by: Optional[str]
sort_order: Optional[SortOrder]
One of the following:
"asc"
"desc"
starting_after: Optional[str]
x_project_id: Optional[str]
ReturnsExpand 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]]

List files

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
)
page = client.files.list()
page = page.items[0]
print(page.id)
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "filename": "filename",
      "md5_checksum": "md5_checksum",
      "mime_type": "mime_type",
      "size": 0,
      "duration_seconds": 0,
      "object": "file",
      "tags": {
        "foo": "bar"
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
Returns Examples
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "filename": "filename",
      "md5_checksum": "md5_checksum",
      "mime_type": "mime_type",
      "size": 0,
      "duration_seconds": 0,
      "object": "file",
      "tags": {
        "foo": "bar"
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}