Returns a paginated list of files in your workspace. Results are sorted by when the record was created in Lightfield (createdAt), newest first. 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.
Pass recordId to list that record’s Google Drive, OneDrive and SharePoint tree instead, folders included, ordered by kind, then title, then id. The tree is capped at 1000 rows and paged with after (the last id from the previous page), not offset. A cut-off tree sets truncated to true, and totalCount is then 1000 rather than the size of the tree. after must be an id from this tree. Pass parentId with recordId to list one folder’s children; that listing uses offset. parentId alone is rejected. Only a user can use these filters, and storage items stay out of the unfiltered list.
Required scope: files:read
Rate limit category: Search
List files
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
fileListResponse, err := client.File.List(context.TODO(), githubcomlightfldlightfieldgo.FileListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fileListResponse.Data)
}
{
"data": [
{
"id": "id",
"completedAt": "completedAt",
"createdAt": "createdAt",
"expiresAt": "expiresAt",
"filename": "filename",
"kind": "file",
"mimeType": "mimeType",
"modifiedAt": "modifiedAt",
"parentId": "parentId",
"sizeBytes": -9007199254740991,
"source": "googleDrive",
"status": "PENDING",
"webUrl": "webUrl"
}
],
"object": "object",
"totalCount": 0,
"truncated": true
}Returns Examples
{
"data": [
{
"id": "id",
"completedAt": "completedAt",
"createdAt": "createdAt",
"expiresAt": "expiresAt",
"filename": "filename",
"kind": "file",
"mimeType": "mimeType",
"modifiedAt": "modifiedAt",
"parentId": "parentId",
"sizeBytes": -9007199254740991,
"source": "googleDrive",
"status": "PENDING",
"webUrl": "webUrl"
}
],
"object": "object",
"totalCount": 0,
"truncated": true
}