Skip to content

List files

file.list(FileListParams**kwargs) -> FileListResponse
GET/v1/files

Returns a paginated list of files in your workspace. Use offset and limit to paginate through results. See List endpoints for more information about pagination.

Omits files uploaded through the app and synced chat attachments — both are still retrievable by id. See File uploads for which document classes are listable versus retrievable-only.

Required scope: files:read

Rate limit category: Search

ParametersExpand Collapse
limit: Optional[int]

Maximum number of records to return. Defaults to 25, maximum 25.

minimum1
maximum9007199254740991
offset: Optional[int]

Number of records to skip for pagination. Defaults to 0.

minimum0
maximum9007199254740991
ReturnsExpand Collapse
class FileListResponse:
data: List[Data]

Array of file objects for the current page.

id: str

Unique identifier for the file.

completed_at: Optional[str]

When the file upload was completed.

created_at: str

When the file upload session was created.

expires_at: Optional[str]

When the upload session expires. Null once completed, cancelled, or expired.

filename: str

Original filename.

mime_type: str

MIME type of the file.

size_bytes: int

File size in bytes.

minimum-9007199254740991
maximum9007199254740991
status: Literal["PENDING", "COMPLETED", "CANCELLED", "EXPIRED"]

Current upload status of the file.

One of the following:
"PENDING"
"COMPLETED"
"CANCELLED"
"EXPIRED"
object: str

The object type, always "list".

total_count: int

Total number of matching files.

minimum0
maximum9007199254740991

List files

from lightfield import Lightfield

client = Lightfield(
    api_key="My API Key",
)
file_list_response = client.file.list()
print(file_list_response.data)
{
  "data": [
    {
      "id": "id",
      "completedAt": "completedAt",
      "createdAt": "createdAt",
      "expiresAt": "expiresAt",
      "filename": "filename",
      "mimeType": "mimeType",
      "sizeBytes": -9007199254740991,
      "status": "PENDING"
    }
  ],
  "object": "object",
  "totalCount": 0
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "completedAt": "completedAt",
      "createdAt": "createdAt",
      "expiresAt": "expiresAt",
      "filename": "filename",
      "mimeType": "mimeType",
      "sizeBytes": -9007199254740991,
      "status": "PENDING"
    }
  ],
  "object": "object",
  "totalCount": 0
}